SET(TOOLKIT_APP DRAWEXE) SET(TOOLKIT_APP_MODULES DRAWEXE ) SET(TOOLKIT_APP_LIBS TKDraw TKMesh TKGeomAlgo TKTopAlgo TKHLR TKGeomBase TKG2d TKBRep TKMath TKG3d TKernel TKService ) MESSAGE(STATUS "Processing application: ${TOOLKIT_APP} (${TOOLKIT_APP_MODULES})") SET(TOOLKIT_APP_SOURCE_FILES) FOREACH(MODULE ${TOOLKIT_APP_MODULES}) # add all .cxx/*.c files or each module FILE(GLOB source_files ${${PROJECT_NAME}_SOURCE_DIR}/src/${MODULE}/*.cxx ${${PROJECT_NAME}_SOURCE_DIR}/src/${MODULE}/*.c ${${PROJECT_NAME}_SOURCE_DIR}/drv/${MODULE}/*.cxx ${${PROJECT_NAME}_SOURCE_DIR}/drv/${MODULE}/*.c) #MESSAGE(STATUS "${source_files}") FOREACH(module_source_file ${source_files}) IF (WIN32) # For compilers under Windows a define must be set per file to correctly set the export macro SET_SOURCE_FILES_PROPERTIES(${module_source_file} PROPERTIES COMPILE_FLAGS "-D__${MODULE}_DLL") ENDIF(WIN32) ENDFOREACH(module_source_file ${source_files}) # append these source files to the list of source files of the toolkit SET(TOOLKIT_APP_SOURCE_FILES ${TOOLKIT_APP_SOURCE_FILES} ${source_files}) # required include paths INCLUDE_DIRECTORIES(${${PROJECT_NAME}_SOURCE_DIR}/src/${MODULE} ${${PROJECT_NAME}_SOURCE_DIR}/drv/${MODULE}) ENDFOREACH(MODULE ${TOOLKIT_APP_MODULES}) # Version info IF(NOT ${PROJECT_NAME}_NO_LIBRARY_VERSION) IF(MSVC) SET(TOOLKIT_RESOURCES ${CMAKE_BINARY_DIR}/Version.rc) ADD_DEFINITIONS("-D${PROJECT_NAME}_VERSION_INFO_IS_EXE") ENDIF(MSVC) ENDIF(NOT ${PROJECT_NAME}_NO_LIBRARY_VERSION) ADD_EXECUTABLE(${TOOLKIT_APP} ${TOOLKIT_APP_SOURCE_FILES} ${TOOLKIT_RESOURCES} ) SET_TARGET_PROPERTIES_INSTALL_RPATH(${TOOLKIT_APP} "${${PROJECT_NAME}_INSTALL_PREFIX}/${${PROJECT_NAME}_INSTALL_LIB_DIR};${${PROJECT_NAME}_INSTALL_PREFIX}/${${PROJECT_NAME}_INSTALL_PACKAGE_LIB_DIR}") IF(WIN32 AND (CMAKE_CONFIGURATION_TYPES OR NMAKE)) SET_TARGET_PROPERTIES(${TOOLKIT_APP} PROPERTIES DEBUG_OUTPUT_NAME ${TOOLKIT_APP}${CMAKE_DEBUG_POSTFIX} ) ENDIF(WIN32 AND (CMAKE_CONFIGURATION_TYPES OR NMAKE)) # Set dependencies for thit ToolKit LIST(REMOVE_DUPLICATES TOOLKIT_APP_LIBS) TARGET_LINK_LIBRARIES(${TOOLKIT_APP} ${TOOLKIT_APP_LIBS} ${WIN32_LIBS}) # Those are private libraries INSTALL(TARGETS ${TOOLKIT_APP} RUNTIME DESTINATION ${${PROJECT_NAME}_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries LIBRARY DESTINATION ${${PROJECT_NAME}_INSTALL_PACKAGE_LIB_DIR} COMPONENT RuntimeLibraries ARCHIVE DESTINATION ${${PROJECT_NAME}_INSTALL_PACKAGE_LIB_DIR} COMPONENT Development )