cmake_minimum_required (VERSION 2.6) #general settings project (ggl_test) set (CMAKE_CONFIGURATION_TYPES Debug;Release CACHE STRING "Semicolon separated list of supported configuration types; only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored." FORCE) if (WIN32) set(RELEASE_FLAGS /D_SECURE_SCL=0) set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}) set(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}) set(CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}) set(CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${RELEASE_FLAGS} ) set(CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${RELEASE_FLAGS}) endif (WIN32) #custom options option (TEST_ALGORITHMS "build ggl algorithms tests" on) option (TEST_ARITHMETIC "build ggl arithmetic tests" on) option (TEST_CORE "build ggl core tests" on) option (TEST_ITERATORS "build ggl iterator tests" on) option (TEST_MULTI-ALGORITHMS "build ggl multi-algorithms tests" on) #option (TEST_POINT_CONCEPT "build ggl point_concept tests" on) option (TEST_POLICIES "build ggl policies tests" on) option (TEST_STRATEGIES "build ggl strategies tests" on) #configure required include paths find_path (BOOST_ROOT_DIR boost C:/nobackup/boost_trunk) include_directories (${CMAKE_CURRENT_SOURCE_DIR}) include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../../boost) include_directories (${BOOST_ROOT_DIR}) #add individual tests macro (ADD_TEST_SUBDIR dirname) file (GLOB TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${dirname}/*.cpp) string (REPLACE "/" "_" projname ${dirname}) foreach (test_file ${TEST_FILES}) get_filename_component (test_name ${test_file} NAME_WE) add_executable (${projname}_${test_name} ${test_file}) endforeach (test_file) endmacro (ADD_TEST_SUBDIR) if (TEST_ALGORITHMS) ADD_TEST_SUBDIR (algorithms) endif (TEST_ALGORITHMS) if (TEST_ARITHMETIC) ADD_TEST_SUBDIR (arithmetic) endif (TEST_ARITHMETIC) if (TEST_CORE) ADD_TEST_SUBDIR (core) endif (TEST_CORE) if (TEST_ITERATORS) ADD_TEST_SUBDIR (iterators) endif (TEST_ITERATORS) if (TEST_MULTI-ALGORITHMS) ADD_TEST_SUBDIR (multi/algorithms) endif (TEST_MULTI-ALGORITHMS) #if (TEST_POINT_CONCEPT) # ADD_TEST_SUBDIR (point_concept) #endif (TEST_POINT_CONCEPT) if (TEST_POLICIES) ADD_TEST_SUBDIR (policies) endif (TEST_POLICIES) if (TEST_STRATEGIES) ADD_TEST_SUBDIR (strategies) endif (TEST_STRATEGIES)