# Set the directory of where the source code is located. set(src_path src) set(esfsm_include_path ${CMAKE_CURRENT_SOURCE_DIR}/../../include) # Trace back to the esmfsm path set(include_path include) if (UNIX) #name mangling, these functions are generated by the FortranCInterface cmake package and might be system dependent include(FortranCInterface) FortranCInterface_HEADER("${CMAKE_CURRENT_SOURCE_DIR}/include/FortranCInterface.h" MACRO_NAMESPACE "FC_") #produce a config.h to be included configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in ${CMAKE_CURRENT_SOURCE_DIR}/include/config.h) set(configFile "${CMAKE_CURRENT_SOURCE_DIR}/include/config.h") add_definitions(-DHAVE_CONFIG_H) add_definitions(-DD3D_PLUGIN_EXT=".so") add_definitions(-DHAVE_STRUCT_TIMESPEC) endif(UNIX) # Gather source files file(GLOB header_files ${include_path}/*.h) file(GLOB esm_global_header_files ${esfsm_include_path}/*.h) file(GLOB esm_files ${src_path}/esm/*.cpp) file(GLOB fsm_files ${src_path}/fsm/*.cpp) # Define library include_directories(${include_path} ${esfsm_include_path} ${pthreads_path}) set(library_name esmfsm_c) add_library(${library_name} ${esm_files} ${fsm_files} ${header_files} ${esm_global_header_files}) # Set dependencies set(oss_dependencies esmfsm_version_number) oss_include_libraries(${library_name} oss_dependencies) if(UNIX) target_compile_options(${library_name} PRIVATE ${cpp_compiler_flags}) target_link_libraries(${library_name} ${oss_dependencies}) endif(UNIX) # Define how the files should be structured within Visual Studio source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${esm_files} ${fsm_files} ${header_files}) set_target_properties (${library_name} PROPERTIES FOLDER utils_lgpl/esmfsm)