### Setup search paths for headers ## include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ### Add Boost and Threads find_package(Boost 1.42 COMPONENTS thread REQUIRED) find_package(Threads) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) ### Setup doxygen documentation # TODO put into helpers.cmake find_package(Doxygen) if(DOXYGEN_FOUND) # Using a .in file means we can use CMake to insert project settings # into the doxyfile. For example, CMake will replace @PROJECT_NAME@ in # a configured file with the CMake PROJECT_NAME variable's value. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY} ) ## call make doc to generate documentation add_custom_target( doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "[${PROJECT_NAME}] Generating fail* documentation with Doxygen" VERBATIM ) endif(DOXYGEN_FOUND) ## Add CMakeLists from subdirectories ## # The autogenerated header files add_subdirectory(config) # fail* targets add_subdirectory(jobserver) add_subdirectory(controller) add_subdirectory(SAL) add_subdirectory(util) # Here we add all user-defined experiments (which fills the target list) add_subdirectory(experiments/) message(STATUS "[${PROJECT_NAME}] chosen experiment targets:") foreach(experiment_name ${EXPERIMENTS_ACTIVATED}) message(STATUS "[${PROJECT_NAME}] -> ${experiment_name}") endforeach(experiment_name) # Here we add activated plugins add_subdirectory(plugins/) message(STATUS "[${PROJECT_NAME}] chosen plugin targets:") foreach(plugin_name ${PLUGINS_ACTIVATED}) message(STATUS "[${PROJECT_NAME}] -> ${plugin_name}") endforeach(plugin_name) ## Merge all resulting fail* libs into a single libfail.a and copy it into the fail source directory add_custom_target(fail COMMAND ${CMAKE_SOURCE_DIR}/cmake/mergelib.sh ${LIBRARY_OUTPUT_PATH} && ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/libfail.a ${CMAKE_SOURCE_DIR}/core ) ## Setup build dependencies of the fail* lib ## -> the fail* targets and user defined experiment targets add_dependencies(fail SAL util controller jobserver protomessages ${EXPERIMENTS_ACTIVATED} ${PLUGINS_ACTIVATED}) # Let make clean also delete libfail.a set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${LIBRARY_OUTPUT_PATH}/libfail.a)