# Define library set(library_name flow2d3d_plugin_culvert_c) # Set directory which contains all source files set(src_path src) set(plugin_culvert_c_include_path ${CMAKE_CURRENT_SOURCE_DIR}/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") include_directories(${NETCDF_INCLUDEDIR}) add_definitions(-DHAVE_CONFIG_H) endif(UNIX) include_directories(${plugin_culvert_c_include_path}) # Gather source files file(GLOB header_files ${plugin_culvert_c_include_path}/*.h) file(GLOB source_files ${src_path}/*.c) add_library(${library_name} ${header_files} ${source_files}) if(WIN32) target_compile_definitions(${library_name} PRIVATE "WIN32") endif(WIN32) if(UNIX) target_compile_definitions(${library_name} PRIVATE "HAVE_CONFIG_H") endif(UNIX) # Define how the files should be structured within Visual Studio source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${source_files}) set_target_properties (${library_name} PROPERTIES FOLDER engines_gpl/flow2d3d) # Change project flags at the end of this file # target_compile_options(${library_name} PRIVATE "${qauto_threaded_flags}")