set(library_name lint_version_number) set(src_path src) 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) # Note that the CMAKE_CURRENT_SOURCE_DIR has a path to THIS CMakeLists location set(lint_root_path ${CMAKE_CURRENT_SOURCE_DIR}/../../) # Trace back to the lint root path set(ini_version_file ${CMAKE_CURRENT_SOURCE_DIR}/include/version_number.ini) set(h_version_file ${CMAKE_CURRENT_SOURCE_DIR}/include/version_number.h) set(rc_version_file ${CMAKE_CURRENT_SOURCE_DIR}/include/version_number.rc) # Generate version files generate_version_files(${rc_version_file} ${ini_version_file} ON) generate_version_files(${h_version_file} ${ini_version_file} ON) # Gather source files set(header_path include) file(GLOB source_files ${src_path}/*.c) file(GLOB headers ${header_path}/*.h) include_directories(${header_path}) add_library(${library_name} ${source_files} ${h_version_file} ${headers}) # Define prebuild events prebuild_version_number(${library_name} ${rc_version_file} ${checkout_src_root} ${ini_version_file} ON) prebuild_version_number(${library_name} ${h_version_file} ${checkout_src_root} ${ini_version_file} ON) # Define how the files should be structured within Visual Studio source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${source_files} ${h_version_file} ${headers}) set_target_properties (${library_name} PROPERTIES FOLDER tools_gpl/lint)