diff --git a/edo/test/CMakeLists.txt b/edo/test/CMakeLists.txt index ffc0cfdb8..0d98852fe 100644 --- a/edo/test/CMakeLists.txt +++ b/edo/test/CMakeLists.txt @@ -23,16 +23,18 @@ ### 3) Define your targets and link the librairies ###################################################################################### -FIND_PACKAGE(Boost 1.33.0) +find_package(Boost 1.33.0) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/application/common) +include_directories(${CMAKE_SOURCE_DIR}/application/common) +include_directories(${EO_SRC_DIR}/src) +include_directories(${EDO_SRC_DIR}/src) -SET(SOURCES +set(SOURCES #t-cholesky t-variance t-edoEstimatorNormalMulti @@ -44,11 +46,11 @@ SET(SOURCES t-repairer-modulo ) -FOREACH(current ${SOURCES}) - ADD_EXECUTABLE(${current} ${current}.cpp) - ADD_TEST(${current} ${current}) - TARGET_LINK_LIBRARIES(${current} edo edoutils ${EO_LIBRARIES} ${MO_LIBRARIES} ${Boost_LIBRARIES}) - INSTALL(TARGETS ${current} RUNTIME DESTINATION share/edo/test COMPONENT test) -ENDFOREACH() +foreach(current ${SOURCES}) + add_executable(${current} ${current}.cpp) + add_test(${current} ${current}) + target_link_libraries(${current} eo eoutils edoutils ${Boost_LIBRARIES}) + install(TARGETS ${current} RUNTIME DESTINATION share/edo/test COMPONENT test) +endforeach() ###################################################################################### diff --git a/eo/app/gprop/CMakeLists.txt b/eo/app/gprop/CMakeLists.txt index d0e71e9a0..98b82e11f 100644 --- a/eo/app/gprop/CMakeLists.txt +++ b/eo/app/gprop/CMakeLists.txt @@ -2,30 +2,30 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${EO_SRC_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### -### 2) Specify where CMake can find the libraries (mandatory: before 3) ) +### 2) specify where cmake can find the libraries (mandatory: before 3) ) ###################################################################################### -LINK_DIRECTORIES(${EO_BIN_DIR}/lib) +link_directories(${EO_BIN_DIR}/lib) ###################################################################################### -### 3) Define your target(s): just an executable here +### 3) define your target(s): just an executable here ###################################################################################### -SET (GPROP_SOURCES gprop.cpp) +set (GPROP_SOURCES gprop.cpp) # especially for Visual Studio -IF(NOT WIN32 OR CYGWIN) - ADD_EXECUTABLE(gprop ${GPROP_SOURCES}) - ADD_DEPENDENCIES(gprop eo eoutils) +if(NOT WIN32 OR CYGWIN) + add_executable(gprop ${GPROP_SOURCES}) + add_dependencies(gprop eo eoutils) - TARGET_LINK_LIBRARIES(gprop eo eoutils) + target_link_libraries(gprop eo eoutils) - SET(GPROP_VERSION ${GLOBAL_VERSION}) - SET_TARGET_PROPERTIES(gprop PROPERTIES VERSION "${GPROP_VERSION}") -ENDIF(NOT WIN32 OR CYGWIN) + set(GPROP_VERSION ${GLOBAL_VERSION}) + set_target_properties(gprop PROPERTIES VERSION "${GPROP_VERSION}") +endif(NOT WIN32 OR CYGWIN) ###################################################################################### diff --git a/eo/app/gpsymreg/CMakeLists.txt b/eo/app/gpsymreg/CMakeLists.txt index 893ac3b8b..647d65e6f 100644 --- a/eo/app/gpsymreg/CMakeLists.txt +++ b/eo/app/gpsymreg/CMakeLists.txt @@ -2,37 +2,37 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${EO_SRC_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### -### 2) Specify where CMake can find the libraries (mandatory: before 3) ) +### 2) specify where cmake can find the libraries (mandatory: before 3) ) ###################################################################################### -LINK_DIRECTORIES(${EO_BIN_DIR}/lib) +link_directories(${EO_BIN_DIR}/lib) ###################################################################################### -### 3) Define your target(s): just an executable here +### 3) define your target(s): just an executable here ###################################################################################### -SET (GPSYMREG_SOURCES main.cpp) +set (GPSYMREG_SOURCES main.cpp) # no matter what is the OS, hopefully -ADD_EXECUTABLE(gpsymreg ${GPSYMREG_SOURCES}) +add_executable(gpsymreg ${GPSYMREG_SOURCES}) -ADD_DEPENDENCIES(gpsymreg eo eoutils) +add_dependencies(gpsymreg eo eoutils) ###################################################################################### -### 4) Optionnal: define your target(s)'s version: no effect for windows +### 4) optionnal: define your target(s)'s version: no effect for windows ###################################################################################### -SET(GPSYMREG_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(gpsymreg PROPERTIES VERSION "${GPSYMREG_VERSION}") +set(GPSYMREG_VERSION ${GLOBAL_VERSION}) +set_target_properties(gpsymreg PROPERTIES VERSION "${GPSYMREG_VERSION}") ###################################################################################### -### 5) Link the librairies for your target(s) +### 5) link the librairies for your target(s) ###################################################################################### -TARGET_LINK_LIBRARIES(gpsymreg eo eoutils) +target_link_libraries(gpsymreg eo eoutils) ###################################################################################### diff --git a/eo/src/es/CMakeLists.txt b/eo/src/es/CMakeLists.txt index 77c54f6e0..4f924bfe6 100644 --- a/eo/src/es/CMakeLists.txt +++ b/eo/src/es/CMakeLists.txt @@ -2,19 +2,19 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${EO_SRC_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### ### 2) Define the es and cma targets ###################################################################################### -SET(ES_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) -SET(CMA_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) +set(ES_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) +set(CMA_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) -SET(LIBRARY_OUTPUT_PATH ${ES_LIB_OUTPUT_PATH}) # the same output for the two libs +set(LIBRARY_OUTPUT_PATH ${ES_LIB_OUTPUT_PATH}) # the same output for the two libs -SET(ES_SOURCES +set(ES_SOURCES make_algo_scalar_es.cpp make_algo_scalar_real.cpp make_checkpoint_es.cpp @@ -31,26 +31,26 @@ SET(ES_SOURCES make_run_real.cpp ) -SET(CMA_SOURCES +set(CMA_SOURCES eig.cpp CMAState.cpp CMAParams.cpp ) -ADD_LIBRARY(es STATIC ${ES_SOURCES}) -INSTALL(TARGETS es ARCHIVE DESTINATION local/${LIB} COMPONENT libraries) +add_library(es STATIC ${ES_SOURCES}) +install(TARGETS es ARCHIVE DESTINATION local/${LIB} COMPONENT libraries) -ADD_LIBRARY(cma STATIC ${CMA_SOURCES}) -INSTALL(TARGETS cma ARCHIVE DESTINATION local/${LIB} COMPONENT libraries) +add_library(cma STATIC ${CMA_SOURCES}) +install(TARGETS cma ARCHIVE DESTINATION local/${LIB} COMPONENT libraries) ###################################################################################### ### 3) Optionnal ###################################################################################### -SET(ES_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(es PROPERTIES VERSION "${ES_VERSION}") +set(ES_VERSION ${GLOBAL_VERSION}) +set_target_properties(es PROPERTIES VERSION "${ES_VERSION}") -SET(CMA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(cma PROPERTIES VERSION "${CMA_VERSION}") +set(CMA_VERSION ${GLOBAL_VERSION}) +set_target_properties(cma PROPERTIES VERSION "${CMA_VERSION}") ###################################################################################### diff --git a/eo/src/ga/CMakeLists.txt b/eo/src/ga/CMakeLists.txt index f1dcca276..a2ee1033b 100644 --- a/eo/src/ga/CMakeLists.txt +++ b/eo/src/ga/CMakeLists.txt @@ -2,17 +2,17 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${EO_SRC_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### ### 2) Define the ga target ###################################################################################### -SET(GA_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) -SET(LIBRARY_OUTPUT_PATH ${GA_LIB_OUTPUT_PATH}) +set(GA_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) +set(LIBRARY_OUTPUT_PATH ${GA_LIB_OUTPUT_PATH}) -SET(GA_SOURCES +set(GA_SOURCES make_algo_scalar_ga.cpp make_checkpoint_ga.cpp make_continue_ga.cpp @@ -22,17 +22,17 @@ SET(GA_SOURCES make_run_ga.cpp ) -ADD_LIBRARY(ga STATIC ${GA_SOURCES}) -INSTALL(TARGETS ga ARCHIVE DESTINATION lib COMPONENT libraries) +add_library(ga STATIC ${GA_SOURCES}) +install(TARGETS ga ARCHIVE DESTINATION lib COMPONENT libraries) -FILE(GLOB HDRS *.h) -INSTALL(FILES ${HDRS} DESTINATION include/eo/ga COMPONENT headers) +file(GLOB HDRS *.h) +install(FILES ${HDRS} DESTINATION include/eo/ga COMPONENT headers) ###################################################################################### ### 3) Optionnal ###################################################################################### -SET(GA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(ga PROPERTIES VERSION "${GA_VERSION}") +set(GA_VERSION ${GLOBAL_VERSION}) +set_target_properties(ga PROPERTIES VERSION "${GA_VERSION}") ###################################################################################### diff --git a/eo/src/mpi/CMakeLists.txt b/eo/src/mpi/CMakeLists.txt index a94d3af95..bed081847 100644 --- a/eo/src/mpi/CMakeLists.txt +++ b/eo/src/mpi/CMakeLists.txt @@ -2,34 +2,34 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${EO_SRC_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### ### 2) Define the eompi target ###################################################################################### -SET(EOMPI_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) -SET(LIBRARY_OUTPUT_PATH ${EOMPI_LIB_OUTPUT_PATH}) +set(EOMPI_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) +set(LIBRARY_OUTPUT_PATH ${EOMPI_LIB_OUTPUT_PATH}) -SET(EOMPI_SOURCES +set(EOMPI_SOURCES eoMpi.cpp eoMpiAssignmentAlgorithm.cpp eoMpiNode.cpp implMpi.cpp ) -ADD_LIBRARY(eompi STATIC ${EOMPI_SOURCES}) -INSTALL(TARGETS eompi ARCHIVE DESTINATION local/${LIB} COMPONENT libraries) +add_library(eompi STATIC ${EOMPI_SOURCES}) +install(TARGETS eompi ARCHIVE DESTINATION local/${LIB} COMPONENT libraries) -FILE(GLOB HDRS *.h) -INSTALL(FILES ${HDRS} DESTINATION local/include${INSTALL_SUB_DIR}/eo/mpi COMPONENT headers) +file(GLOB HDRS *.h) +install(FILES ${HDRS} DESTINATION local/include${INSTALL_SUB_DIR}/eo/mpi COMPONENT headers) ###################################################################################### ### 3) Optionnal ###################################################################################### -SET(EOMPI_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(eompi PROPERTIES VERSION "${EOMPI_VERSION}") +set(EOMPI_VERSION ${GLOBAL_VERSION}) +set_target_properties(eompi PROPERTIES VERSION "${EOMPI_VERSION}") ###################################################################################### diff --git a/eo/src/pyeo/CMakeLists.txt b/eo/src/pyeo/CMakeLists.txt index 697c96a16..05d5ec459 100644 --- a/eo/src/pyeo/CMakeLists.txt +++ b/eo/src/pyeo/CMakeLists.txt @@ -15,49 +15,49 @@ # # ---------------------------------------------------------------------------- -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +cmake_minimum_required(VERSION 2.8) -PROJECT(PyEO) +project(PyEO) -FIND_PACKAGE(Boost 1.42 COMPONENTS python) -FIND_PACKAGE(PythonLibs) +find_package(Boost 1.42 COMPONENTS python) +find_package(PythonLibs) -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(${PYTHON_INCLUDE_PATH}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) -IF(APPLE) +if(APPLE) # osx internal - FIND_LIBRARY(APPLE_CARBON Carbon) -ENDIF(APPLE) + find_library(APPLE_CARBON Carbon) +endif(APPLE) # includes -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -#INCLUDE_DIRECTORIES(../) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +#include_directories(../) # source -FILE(GLOB SOURCES *.cpp) +file(GLOB SOURCES *.cpp) # EO dependencies -SET(EO_SOURCES - ${EO_SOURCE_DIR}/src/eoFunctorStore.cpp - ${EO_SOURCE_DIR}/src/utils/eoLogger.cpp - ${EO_SOURCE_DIR}/src/utils/eoParallel.cpp +set(EO_SOURCES + ${EO_SRC_DIR}/src/eoFunctorStore.cpp + ${EO_SRC_DIR}/src/utils/eoLogger.cpp + ${EO_SRC_DIR}/src/utils/eoParallel.cpp ) # shared library -ADD_LIBRARY(PyEO MODULE ${SOURCES} ${EO_SOURCES}) -INSTALL(TARGETS PyEO LIBRARY DESTINATION local/${LIB} COMPONENT libraries) +add_library(PyEO MODULE ${SOURCES} ${EO_SOURCES}) +install(TARGETS PyEO LIBRARY DESTINATION local/${LIB} COMPONENT libraries) # python 2.5 must have pyd -IF(WIN32 AND NOT CYGWIN) - SET_TARGET_PROPERTIES(PyEO PROPERTIES SUFFIX ".pyd") -ENDIF(WIN32 AND NOT CYGWIN) +if(WIN32 AND NOT CYGWIN) + set_target_properties(PyEO PROPERTIES SUFFIX ".pyd") +endif(WIN32 AND NOT CYGWIN) # add the libs -IF(APPLE) - TARGET_LINK_LIBRARIES(PyEO ${APPLE_CARBON} ${PYTHON_LIBRARY} ${Boost_LIBRARIES}) -ELSE(APPLE) - TARGET_LINK_LIBRARIES(PyEO ${PYTHON_LIBRARY} ${Boost_LIBRARIES}) -ENDIF(APPLE) +if(APPLE) + target_link_libraries(PyEO ${APPLE_CARBON} ${PYTHON_LIBRARY} ${Boost_LIBRARIES}) +else(APPLE) + target_link_libraries(PyEO ${PYTHON_LIBRARY} ${Boost_LIBRARIES}) +endif(APPLE) diff --git a/eo/src/serial/CMakeLists.txt b/eo/src/serial/CMakeLists.txt index 937044974..43d1ce451 100644 --- a/eo/src/serial/CMakeLists.txt +++ b/eo/src/serial/CMakeLists.txt @@ -2,34 +2,34 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${EO_SRC_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### ### 2) Define the eoserial target ###################################################################################### -SET(EOSERIAL_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) -SET(LIBRARY_OUTPUT_PATH ${EOSERIAL_LIB_OUTPUT_PATH}) +set(EOSERIAL_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) +set(LIBRARY_OUTPUT_PATH ${EOSERIAL_LIB_OUTPUT_PATH}) -SET(EOSERIAL_SOURCES +set(EOSERIAL_SOURCES Array.cpp Object.cpp Parser.cpp String.cpp ) -ADD_LIBRARY(eoserial STATIC ${EOSERIAL_SOURCES}) -INSTALL(TARGETS eoserial ARCHIVE DESTINATION lib COMPONENT libraries) +add_library(eoserial STATIC ${EOSERIAL_SOURCES}) +install(TARGETS eoserial ARCHIVE DESTINATION lib COMPONENT libraries) -FILE(GLOB HDRS *.h) -INSTALL(FILES ${HDRS} DESTINATION include/eo/serial COMPONENT headers) +file(GLOB HDRS *.h) +install(FILES ${HDRS} DESTINATION include/eo/serial COMPONENT headers) ###################################################################################### ### 3) Optionnal ###################################################################################### -SET(EOSERIAL_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(eoserial PROPERTIES VERSION "${EOSERIAL_VERSION}") +set(EOSERIAL_VERSION ${GLOBAL_VERSION}) +set_target_properties(eoserial PROPERTIES VERSION "${EOSERIAL_VERSION}") ###################################################################################### diff --git a/eo/src/utils/CMakeLists.txt b/eo/src/utils/CMakeLists.txt index f66406880..e64cf5e4c 100644 --- a/eo/src/utils/CMakeLists.txt +++ b/eo/src/utils/CMakeLists.txt @@ -2,17 +2,17 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${EO_SRC_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### ### 2) Define the ga target ###################################################################################### -SET(EOUTILS_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) -SET(LIBRARY_OUTPUT_PATH ${EOUTILS_LIB_OUTPUT_PATH}) +set(EOUTILS_LIB_OUTPUT_PATH ${EO_BIN_DIR}/lib) +set(LIBRARY_OUTPUT_PATH ${EOUTILS_LIB_OUTPUT_PATH}) -SET(EOUTILS_SOURCES +set(EOUTILS_SOURCES eoData.cpp eoFileMonitor.cpp eoGnuplot.cpp @@ -32,15 +32,15 @@ SET(EOUTILS_SOURCES eoSignal.cpp ) -ADD_LIBRARY(eoutils STATIC ${EOUTILS_SOURCES}) -INSTALL(TARGETS eoutils ARCHIVE DESTINATION local/${LIB} COMPONENT libraries) +add_library(eoutils STATIC ${EOUTILS_SOURCES}) +install(TARGETS eoutils ARCHIVE DESTINATION local/${LIB} COMPONENT libraries) ###################################################################################### ### 3) Optionnal ###################################################################################### -SET(EOUTILS_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(eoutils PROPERTIES VERSION "${EOUTILS_VERSION}") +set(EOUTILS_VERSION ${GLOBAL_VERSION}) +set_target_properties(eoutils PROPERTIES VERSION "${EOUTILS_VERSION}") ###################################################################################### diff --git a/eo/test/CMakeLists.txt b/eo/test/CMakeLists.txt index 3fba65f4c..6f05ecde9 100644 --- a/eo/test/CMakeLists.txt +++ b/eo/test/CMakeLists.txt @@ -9,22 +9,22 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/contrib) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/contrib/MGE) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${EO_SRC_DIR}/src) +include_directories(${EO_SRC_DIR}/contrib) +include_directories(${EO_SRC_DIR}/contrib/MGE) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### -LINK_DIRECTORIES(${EO_BIN_DIR}/lib) +link_directories(${EO_BIN_DIR}/lib) ###################################################################################### ### 3) Define your targets and link the librairies ###################################################################################### -SET (TEST_LIST +set (TEST_LIST t-eofitness t-eoRandom t-eobin @@ -72,45 +72,45 @@ SET (TEST_LIST ) -FOREACH (test ${TEST_LIST}) - SET ("T_${test}_SOURCES" "${test}.cpp") -ENDFOREACH (test) +foreach (test ${TEST_LIST}) + set ("T_${test}_SOURCES" "${test}.cpp") +endforeach (test) -IF(ENABLE_MINIMAL_CMAKE_TESTING) +if(ENABLE_MINIMAL_CMAKE_TESTING) - SET (MIN_TEST_LIST t-eoEasyPSO) - FOREACH (mintest ${MIN_TEST_LIST}) - SET ("T_${mintest}_SOURCES" "${mintest}.cpp") - ADD_EXECUTABLE(${mintest} ${T_${mintest}_SOURCES}) - ADD_TEST(${mintest} ${mintest}) - TARGET_LINK_LIBRARIES(${mintest} ga es cma eoutils eo) - ENDFOREACH (mintest) + set (MIN_TEST_LIST t-eoEasyPSO) + foreach (mintest ${MIN_TEST_LIST}) + set ("T_${mintest}_SOURCES" "${mintest}.cpp") + add_executable(${mintest} ${T_${mintest}_SOURCES}) + add_test(${mintest} ${mintest}) + target_link_libraries(${mintest} ga es cma eoutils eo) + endforeach (mintest) -ELSEIF(ENABLE_CMAKE_TESTING) +elseif(ENABLE_CMAKE_TESTING) - FOREACH (test ${TEST_LIST}) - ADD_EXECUTABLE(${test} ${T_${test}_SOURCES}) - ADD_TEST(${test} ${test}) - TARGET_LINK_LIBRARIES(${test} ga es cma eoutils eo) - INSTALL(TARGETS ${test} RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/test COMPONENT test) - ENDFOREACH (test) + foreach (test ${TEST_LIST}) + add_executable(${test} ${T_${test}_SOURCES}) + add_test(${test} ${test}) + target_link_libraries(${test} ga es cma eoutils eo) + install(TARGETS ${test} RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/test COMPONENT test) + endforeach (test) - SET(RESOURCES + set(RESOURCES boxplot.py boxplot_to_png.py boxplot_to_pdf.py t-openmp.py ) - FOREACH(file ${RESOURCES}) - EXECUTE_PROCESS( + foreach(file ${RESOURCES}) + execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR}/${file} ) - ENDFOREACH(file) + endforeach(file) -ENDIF(ENABLE_MINIMAL_CMAKE_TESTING) +endif(ENABLE_MINIMAL_CMAKE_TESTING) ###################################################################################### diff --git a/eo/test/mpi/CMakeLists.txt b/eo/test/mpi/CMakeLists.txt index 525508117..325056da7 100644 --- a/eo/test/mpi/CMakeLists.txt +++ b/eo/test/mpi/CMakeLists.txt @@ -8,25 +8,25 @@ ### 1) Include the sources ###################################################################################### -MESSAGE("EO SOURCE DIR: ${EO_SOURCE_DIR}") -MESSAGE("OMPI: ${MPI_DIR}") +message("EO SOURCE DIR: ${EO_SRC_DIR}") +message("OMPI: ${MPI_DIR}") -INCLUDE_DIRECTORIES(${MPI_DIR}/include) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${MPI_DIR}/include) +include_directories(${EO_SRC_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### -LINK_DIRECTORIES(${EO_BIN_DIR}/lib) -LINK_DIRECTORIES(${MPI_DIR}/lib) +link_directories(${EO_BIN_DIR}/lib) +link_directories(${MPI_DIR}/lib) ###################################################################################### ### 3) Define your targets and link the librairies ###################################################################################### -SET (TEST_LIST +set (TEST_LIST t-mpi-parallelApply t-mpi-wrapper t-mpi-multipleRoles @@ -35,20 +35,20 @@ SET (TEST_LIST t-mpi-distrib-exp ) -FOREACH (test ${TEST_LIST}) - SET ("T_${test}_SOURCES" "${test}.cpp") -ENDFOREACH (test) +foreach (test ${TEST_LIST}) + set ("T_${test}_SOURCES" "${test}.cpp") +endforeach (test) -SET(CMAKE_CXX_COMPILER "mpicxx") -ADD_DEFINITIONS(-DWITH_MPI) +set(CMAKE_CXX_COMPILER "mpicxx") +add_definitions(-DWITH_MPI) -IF(ENABLE_CMAKE_TESTING) - FOREACH (test ${TEST_LIST}) - ADD_EXECUTABLE(${test} ${T_${test}_SOURCES}) - ADD_TEST(${test} ${test}) - TARGET_LINK_LIBRARIES(${test} eoutils eompi eoserial eo) - INSTALL(TARGETS ${test} RUNTIME DESTINATION share/eo/test COMPONENT test) - ENDFOREACH (test) -ENDIF() +if(ENABLE_CMAKE_TESTING) + foreach (test ${TEST_LIST}) + add_executable(${test} ${T_${test}_SOURCES}) + add_test(${test} ${test}) + target_link_libraries(${test} eoutils eompi eoserial eo) + install(TARGETS ${test} RUNTIME DESTINATION share/eo/test COMPONENT test) + endforeach (test) +endif() ###################################################################################### diff --git a/eo/tutorial/Lesson1/CMakeLists.txt b/eo/tutorial/Lesson1/CMakeLists.txt index a80b3f404..96619394d 100644 --- a/eo/tutorial/Lesson1/CMakeLists.txt +++ b/eo/tutorial/Lesson1/CMakeLists.txt @@ -2,63 +2,63 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/ga) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/utils) +include_directories(${EO_SRC_DIR}/src) +include_directories(${EO_SRC_DIR}/src/ga) +include_directories(${EO_SRC_DIR}/src/utils) ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### -IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib) -ENDIF(NOT WIN32 OR CYGWIN) +if(NOT WIN32 OR CYGWIN) + link_directories(${EO_BIN_DIR}/lib) +endif(NOT WIN32 OR CYGWIN) # especially for Visual Studio -IF(WIN32 AND NOT CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) -ENDIF(WIN32 AND NOT CYGWIN) +if(WIN32 AND NOT CYGWIN) + link_directories(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) +endif(WIN32 AND NOT CYGWIN) ###################################################################################### ### 3) Define your targets ###################################################################################### # no matter what is the OS, hopefully -ADD_EXECUTABLE(FirstBitGA FirstBitGA.cpp) -ADD_EXECUTABLE(FirstRealGA FirstRealGA.cpp) -ADD_EXECUTABLE(exercise1.3 exercise1.3.cpp) +add_executable(FirstBitGA FirstBitGA.cpp) +add_executable(FirstRealGA FirstRealGA.cpp) +add_executable(exercise1.3 exercise1.3.cpp) -ADD_DEPENDENCIES(FirstBitGA ga eo eoutils) -ADD_DEPENDENCIES(FirstRealGA ga eo eoutils) -ADD_DEPENDENCIES(exercise1.3 ga eo eoutils) +add_dependencies(FirstBitGA ga eo eoutils) +add_dependencies(FirstRealGA ga eo eoutils) +add_dependencies(exercise1.3 ga eo eoutils) ###################################################################################### ### 4) Optionnal ###################################################################################### -SET(FIRSTBITGA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(FirstBitGA PROPERTIES VERSION "${FIRSTBITGA_VERSION}") +set(FIRSTBITGA_VERSION ${GLOBAL_VERSION}) +set_target_properties(FirstBitGA PROPERTIES VERSION "${FIRSTBITGA_VERSION}") -SET(FIRSTREALGA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(FirstRealGA PROPERTIES VERSION "${FIRSTREALGA_VERSION}") +set(FIRSTREALGA_VERSION ${GLOBAL_VERSION}) +set_target_properties(FirstRealGA PROPERTIES VERSION "${FIRSTREALGA_VERSION}") -SET(EXERCICE13_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(exercise1.3 PROPERTIES VERSION "${EXERCICE13_VERSION}") +set(EXERCICE13_VERSION ${GLOBAL_VERSION}) +set_target_properties(exercise1.3 PROPERTIES VERSION "${EXERCICE13_VERSION}") ###################################################################################### ### 5) Link the librairies for the targets ###################################################################################### -TARGET_LINK_LIBRARIES(FirstBitGA ga eo eoutils) -TARGET_LINK_LIBRARIES(FirstRealGA ga eo eoutils) -TARGET_LINK_LIBRARIES(exercise1.3 ga eo eoutils) +target_link_libraries(FirstBitGA ga eo eoutils) +target_link_libraries(FirstRealGA ga eo eoutils) +target_link_libraries(exercise1.3 ga eo eoutils) ###################################################################################### ### 6) Configure project installation paths ###################################################################################### -INSTALL(TARGETS FirstBitGA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson1 COMPONENT examples) -INSTALL(TARGETS FirstRealGA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson1 COMPONENT examples) -INSTALL(TARGETS exercise1.3 RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson1 COMPONENT examples) +install(TARGETS FirstBitGA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson1 COMPONENT examples) +install(TARGETS FirstRealGA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson1 COMPONENT examples) +install(TARGETS exercise1.3 RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson1 COMPONENT examples) ###################################################################################### diff --git a/eo/tutorial/Lesson2/CMakeLists.txt b/eo/tutorial/Lesson2/CMakeLists.txt index 876e1689f..519e8a0e7 100644 --- a/eo/tutorial/Lesson2/CMakeLists.txt +++ b/eo/tutorial/Lesson2/CMakeLists.txt @@ -2,59 +2,59 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/ga) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/utils) +include_directories(${EO_SRC_DIR}/src) +include_directories(${EO_SRC_DIR}/src/ga) +include_directories(${EO_SRC_DIR}/src/utils) ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### -IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib) -ENDIF(NOT WIN32 OR CYGWIN) +if(NOT WIN32 OR CYGWIN) + link_directories(${EO_BIN_DIR}/lib) +endif(NOT WIN32 OR CYGWIN) # especially for Visual Studio -IF(WIN32 AND NOT CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) -ENDIF(WIN32 AND NOT CYGWIN) +if(WIN32 AND NOT CYGWIN) + link_directories(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) +endif(WIN32 AND NOT CYGWIN) ###################################################################################### ### 3) Define your targets ###################################################################################### # no matter what is the OS, hopefully -ADD_EXECUTABLE(FirstBitEA FirstBitEA.cpp) -ADD_EXECUTABLE(FirstRealEA FirstRealEA.cpp) -ADD_EXECUTABLE(exercise2.3 exercise2.3.cpp) +add_executable(FirstBitEA FirstBitEA.cpp) +add_executable(FirstRealEA FirstRealEA.cpp) +add_executable(exercise2.3 exercise2.3.cpp) ###################################################################################### ### 4) Optionnal ###################################################################################### -SET(FIRSTBITEA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(FirstBitEA PROPERTIES VERSION "${FIRSTBITEA_VERSION}") +set(FIRSTBITEA_VERSION ${GLOBAL_VERSION}) +set_target_properties(FirstBitEA PROPERTIES VERSION "${FIRSTBITEA_VERSION}") -SET(FIRSTREALEA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(FirstRealEA PROPERTIES VERSION "${FIRSTREALEA_VERSION}") +set(FIRSTREALEA_VERSION ${GLOBAL_VERSION}) +set_target_properties(FirstRealEA PROPERTIES VERSION "${FIRSTREALEA_VERSION}") -SET(EXERCICE23_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(exercise2.3 PROPERTIES VERSION "${EXERCICE23_VERSION}") +set(EXERCICE23_VERSION ${GLOBAL_VERSION}) +set_target_properties(exercise2.3 PROPERTIES VERSION "${EXERCICE23_VERSION}") ###################################################################################### ### 5) Link the librairies for the targets ###################################################################################### -TARGET_LINK_LIBRARIES(FirstBitEA ga eo eoutils) -TARGET_LINK_LIBRARIES(FirstRealEA ga eo eoutils) -TARGET_LINK_LIBRARIES(exercise2.3 ga eo eoutils) +target_link_libraries(FirstBitEA ga eo eoutils) +target_link_libraries(FirstRealEA ga eo eoutils) +target_link_libraries(exercise2.3 ga eo eoutils) ###################################################################################### ### 6) Configure project installation paths ###################################################################################### -INSTALL(TARGETS FirstBitEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson2 COMPONENT examples) -INSTALL(TARGETS FirstRealEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson2 COMPONENT examples) -INSTALL(TARGETS exercise2.3 RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson2 COMPONENT examples) +install(TARGETS FirstBitEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson2 COMPONENT examples) +install(TARGETS FirstRealEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson2 COMPONENT examples) +install(TARGETS exercise2.3 RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson2 COMPONENT examples) ###################################################################################### diff --git a/eo/tutorial/Lesson3/CMakeLists.txt b/eo/tutorial/Lesson3/CMakeLists.txt index 926aacc90..d4d7563b2 100644 --- a/eo/tutorial/Lesson3/CMakeLists.txt +++ b/eo/tutorial/Lesson3/CMakeLists.txt @@ -2,63 +2,63 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/ga) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/utils) +include_directories(${EO_SRC_DIR}/src) +include_directories(${EO_SRC_DIR}/src/ga) +include_directories(${EO_SRC_DIR}/src/utils) ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### -IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib) -ENDIF(NOT WIN32 OR CYGWIN) +if(NOT WIN32 OR CYGWIN) + link_directories(${EO_BIN_DIR}/lib) +endif(NOT WIN32 OR CYGWIN) # especially for Visual Studio -IF(WIN32 AND NOT CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) -ENDIF(WIN32 AND NOT CYGWIN) +if(WIN32 AND NOT CYGWIN) + link_directories(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) +endif(WIN32 AND NOT CYGWIN) ###################################################################################### ### 3) Define your targets ###################################################################################### # no matter what is the OS, hopefully -ADD_EXECUTABLE(SecondBitEA SecondBitEA.cpp) -ADD_EXECUTABLE(SecondRealEA SecondRealEA.cpp) -ADD_EXECUTABLE(exercise3.1 exercise3.1.cpp) +add_executable(SecondBitEA SecondBitEA.cpp) +add_executable(SecondRealEA SecondRealEA.cpp) +add_executable(exercise3.1 exercise3.1.cpp) -ADD_DEPENDENCIES(SecondBitEA ga eoutils eo) -ADD_DEPENDENCIES(SecondRealEA ga eoutils eo) -ADD_DEPENDENCIES(exercise3.1 ga eoutils eo) +add_dependencies(SecondBitEA ga eoutils eo) +add_dependencies(SecondRealEA ga eoutils eo) +add_dependencies(exercise3.1 ga eoutils eo) ###################################################################################### ### 4) Optionnal ###################################################################################### -SET(SECONDBITEA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(SecondBitEA PROPERTIES VERSION "${SECONDBITEA_VERSION}") +set(SECONDBITEA_VERSION ${GLOBAL_VERSION}) +set_target_properties(SecondBitEA PROPERTIES VERSION "${SECONDBITEA_VERSION}") -SET(SECONDREALEA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(SecondRealEA PROPERTIES VERSION "${SECONDREALEA_VERSION}") +set(SECONDREALEA_VERSION ${GLOBAL_VERSION}) +set_target_properties(SecondRealEA PROPERTIES VERSION "${SECONDREALEA_VERSION}") -SET(EXERCICE31_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(exercise3.1 PROPERTIES VERSION "${EXERCICE31_VERSION}") +set(EXERCICE31_VERSION ${GLOBAL_VERSION}) +set_target_properties(exercise3.1 PROPERTIES VERSION "${EXERCICE31_VERSION}") ###################################################################################### ### 5) Link the librairies for the targets ###################################################################################### -TARGET_LINK_LIBRARIES(SecondBitEA ga eoutils eo) -TARGET_LINK_LIBRARIES(SecondRealEA ga eoutils eo) -TARGET_LINK_LIBRARIES(exercise3.1 ga eoutils eo) +target_link_libraries(SecondBitEA ga eoutils eo) +target_link_libraries(SecondRealEA ga eoutils eo) +target_link_libraries(exercise3.1 ga eoutils eo) ###################################################################################### ### 6) Configure project installation paths ###################################################################################### -INSTALL(TARGETS SecondBitEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson3 COMPONENT examples) -INSTALL(TARGETS SecondRealEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson3 COMPONENT examples) -INSTALL(TARGETS exercise3.1 RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson3 COMPONENT examples) +install(TARGETS SecondBitEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson3 COMPONENT examples) +install(TARGETS SecondRealEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson3 COMPONENT examples) +install(TARGETS exercise3.1 RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson3 COMPONENT examples) ###################################################################################### diff --git a/eo/tutorial/Lesson4/CMakeLists.txt b/eo/tutorial/Lesson4/CMakeLists.txt index 335272b20..5042796fe 100644 --- a/eo/tutorial/Lesson4/CMakeLists.txt +++ b/eo/tutorial/Lesson4/CMakeLists.txt @@ -2,97 +2,97 @@ ### 0) Copy the ESEA.param and RealEA.param files in the build directory for an easy use. ###################################################################################### -EXECUTE_PROCESS( +execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${EO_SOURCE_DIR}/tutorial/Lesson4/ESEA.param + ${EO_SRC_DIR}/tutorial/Lesson4/ESEA.param ${EO_BIN_DIR}/tutorial/Lesson4/ESEA.param COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${EO_SOURCE_DIR}/tutorial/Lesson4/RealEA.param + ${EO_SRC_DIR}/tutorial/Lesson4/RealEA.param ${EO_BIN_DIR}/tutorial/Lesson4/RealEA.param ) ############## # OLD_TARGETS ############## -#ADD_CUSTOM_TARGET(param DEPENDS ${EO_SOURCE_DIR}/tutorial/Lesson4/ESEA.param) -#ADD_CUSTOM_COMMAND( +#add_custom_target(param DEPENDS ${EO_SRC_DIR}/tutorial/Lesson4/ESEA.param) +#add_custom_command( # TARGET param # POST_BUILD # COMMAND ${CMAKE_COMMAND} # ARGS -E copy_if_different -# ${EO_SOURCE_DIR}/tutorial/Lesson4/ESEA.param +# ${EO_SRC_DIR}/tutorial/Lesson4/ESEA.param # ${EO_BIN_DIR}/tutorial/Lesson4) -#ADD_CUSTOM_TARGET(param DEPENDS ${EO_SOURCE_DIR}/tutorial/Lesson4/RealEA.param) -#ADD_CUSTOM_COMMAND( +#add_custom_target(param DEPENDS ${EO_SRC_DIR}/tutorial/Lesson4/RealEA.param) +#add_custom_command( # TARGET param # POST_BUILD # COMMAND ${CMAKE_COMMAND} # ARGS -E copy_if_different -# ${EO_SOURCE_DIR}/tutorial/Lesson4/RealEA.param +# ${EO_SRC_DIR}/tutorial/Lesson4/RealEA.param # ${EO_BIN_DIR}/tutorial/Lesson4) ###################################################################################### ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/es) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/utils) -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/ga) +include_directories(${EO_SRC_DIR}/src) +include_directories(${EO_SRC_DIR}/src/es) +include_directories(${EO_SRC_DIR}/src/utils) +include_directories(${EO_SRC_DIR}/src/ga) ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### -IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib) -ENDIF(NOT WIN32 OR CYGWIN) +if(NOT WIN32 OR CYGWIN) + link_directories(${EO_BIN_DIR}/lib) +endif(NOT WIN32 OR CYGWIN) # especially for Visual Studio -IF(WIN32 AND NOT CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) -ENDIF(WIN32 AND NOT CYGWIN) +if(WIN32 AND NOT CYGWIN) + link_directories(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) +endif(WIN32 AND NOT CYGWIN) ###################################################################################### ### 3) Define your targets ###################################################################################### # no matter what is the OS, hopefully -ADD_EXECUTABLE(BitEA BitEA.cpp) -ADD_EXECUTABLE(RealEA RealEA.cpp) -ADD_EXECUTABLE(ESEA ESEA.cpp) +add_executable(BitEA BitEA.cpp) +add_executable(RealEA RealEA.cpp) +add_executable(ESEA ESEA.cpp) -#ADD_DEPENDENCIES(BitEA es ga eo eoutils) -#ADD_DEPENDENCIES(RealEA es ga eo eoutils) -#ADD_DEPENDENCIES(ESEA es ga eo eoutils) +#add_dependencies(BitEA es ga eo eoutils) +#add_dependencies(RealEA es ga eo eoutils) +#add_dependencies(ESEA es ga eo eoutils) ###################################################################################### ### 4) Optionnal ###################################################################################### -SET(BITEA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(BitEA PROPERTIES VERSION "${BITEA_VERSION}") +set(BITEA_VERSION ${GLOBAL_VERSION}) +set_target_properties(BitEA PROPERTIES VERSION "${BITEA_VERSION}") -SET(REALEA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(RealEA PROPERTIES VERSION "${REALEA_VERSION}") +set(REALEA_VERSION ${GLOBAL_VERSION}) +set_target_properties(RealEA PROPERTIES VERSION "${REALEA_VERSION}") -SET(ESEA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(ESEA PROPERTIES VERSION "${ESEA_VERSION}") +set(ESEA_VERSION ${GLOBAL_VERSION}) +set_target_properties(ESEA PROPERTIES VERSION "${ESEA_VERSION}") ###################################################################################### ### 5) Link the librairies for the targets ###################################################################################### -TARGET_LINK_LIBRARIES(BitEA es ga eo eoutils) -TARGET_LINK_LIBRARIES(RealEA es ga eo eoutils) -TARGET_LINK_LIBRARIES(ESEA es ga eo eoutils) +target_link_libraries(BitEA es ga eo eoutils) +target_link_libraries(RealEA es ga eo eoutils) +target_link_libraries(ESEA es ga eo eoutils) ###################################################################################### ### 6) Configure project installation paths ###################################################################################### -INSTALL(TARGETS BitEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson4 COMPONENT examples) -INSTALL(TARGETS RealEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson4 COMPONENT examples) -INSTALL(TARGETS ESEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson4 COMPONENT examples) +install(TARGETS BitEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson4 COMPONENT examples) +install(TARGETS RealEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson4 COMPONENT examples) +install(TARGETS ESEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson4 COMPONENT examples) ###################################################################################### diff --git a/eo/tutorial/Lesson5/CMakeLists.txt b/eo/tutorial/Lesson5/CMakeLists.txt index b487804be..2987b041e 100644 --- a/eo/tutorial/Lesson5/CMakeLists.txt +++ b/eo/tutorial/Lesson5/CMakeLists.txt @@ -2,55 +2,55 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${EO_SRC_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### -IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib) -ENDIF(NOT WIN32 OR CYGWIN) +if(NOT WIN32 OR CYGWIN) + link_directories(${EO_BIN_DIR}/lib) +endif(NOT WIN32 OR CYGWIN) # especially for Visual Studio -IF(WIN32 AND NOT CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) -ENDIF(WIN32 AND NOT CYGWIN) +if(WIN32 AND NOT CYGWIN) + link_directories(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) +endif(WIN32 AND NOT CYGWIN) ###################################################################################### ### 3) Define your targets ###################################################################################### # no matter what is the OS, hopefully -ADD_EXECUTABLE(OneMaxEA OneMaxEA.cpp) -ADD_EXECUTABLE(OneMaxLibEA OneMaxLibEA.cpp make_OneMax.cpp) +add_executable(OneMaxEA OneMaxEA.cpp) +add_executable(OneMaxLibEA OneMaxLibEA.cpp make_OneMax.cpp) -ADD_DEPENDENCIES(OneMaxEA es ga eo eoutils) -ADD_DEPENDENCIES(OneMaxLibEA es ga eo eoutils) +add_dependencies(OneMaxEA es ga eo eoutils) +add_dependencies(OneMaxLibEA es ga eo eoutils) ###################################################################################### ### 4) Optionnal ###################################################################################### -SET(ONEMAXEA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(OneMaxEA PROPERTIES VERSION "${ONEMAXEA_VERSION}") +set(ONEMAXEA_VERSION ${GLOBAL_VERSION}) +set_target_properties(OneMaxEA PROPERTIES VERSION "${ONEMAXEA_VERSION}") -SET(ONEMAXLIBEA_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(OneMaxLibEA PROPERTIES VERSION "${ONEMAXLIBEA_VERSION}") +set(ONEMAXLIBEA_VERSION ${GLOBAL_VERSION}) +set_target_properties(OneMaxLibEA PROPERTIES VERSION "${ONEMAXLIBEA_VERSION}") ###################################################################################### ### 5) Link the librairies for the targets ###################################################################################### -TARGET_LINK_LIBRARIES(OneMaxEA es ga eo eoutils) -TARGET_LINK_LIBRARIES(OneMaxLibEA es ga eo eoutils) +target_link_libraries(OneMaxEA es ga eo eoutils) +target_link_libraries(OneMaxLibEA es ga eo eoutils) ###################################################################################### ### 6) Configure project installation paths ###################################################################################### -INSTALL(TARGETS OneMaxEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson5 COMPONENT examples) -INSTALL(TARGETS OneMaxLibEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson5 COMPONENT examples) +install(TARGETS OneMaxEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson5 COMPONENT examples) +install(TARGETS OneMaxLibEA RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson5 COMPONENT examples) ###################################################################################### diff --git a/eo/tutorial/Lesson6/CMakeLists.txt b/eo/tutorial/Lesson6/CMakeLists.txt index c58759233..2df16a459 100644 --- a/eo/tutorial/Lesson6/CMakeLists.txt +++ b/eo/tutorial/Lesson6/CMakeLists.txt @@ -2,50 +2,50 @@ ### 1) Include the sources ###################################################################################### -INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src) +include_directories(${EO_SRC_DIR}/src) ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### -IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib) -ENDIF(NOT WIN32 OR CYGWIN) +if(NOT WIN32 OR CYGWIN) + link_directories(${EO_BIN_DIR}/lib) +endif(NOT WIN32 OR CYGWIN) # especially for Visual Studio -IF(WIN32 AND NOT CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) -ENDIF(WIN32 AND NOT CYGWIN) +if(WIN32 AND NOT CYGWIN) + link_directories(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE}) +endif(WIN32 AND NOT CYGWIN) ###################################################################################### ### 3) Define your targets ###################################################################################### -ADD_EXECUTABLE(BinaryPSO BinaryPSO.cpp) -ADD_EXECUTABLE(RealPSO RealPSO.cpp) +add_executable(BinaryPSO BinaryPSO.cpp) +add_executable(RealPSO RealPSO.cpp) ###################################################################################### ### 4) Optionnal ###################################################################################### -SET(BINARYPSO_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(BinaryPSO PROPERTIES VERSION "${BINARYPSO_VERSION}") +set(BINARYPSO_VERSION ${GLOBAL_VERSION}) +set_target_properties(BinaryPSO PROPERTIES VERSION "${BINARYPSO_VERSION}") -SET(REALPSO_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(RealPSO PROPERTIES VERSION "${REALPSO_VERSION}") +set(REALPSO_VERSION ${GLOBAL_VERSION}) +set_target_properties(RealPSO PROPERTIES VERSION "${REALPSO_VERSION}") ###################################################################################### ### 5) Link the librairies for the targets ###################################################################################### -TARGET_LINK_LIBRARIES(BinaryPSO eo eoutils) -TARGET_LINK_LIBRARIES(RealPSO eo eoutils) +target_link_libraries(BinaryPSO eo eoutils) +target_link_libraries(RealPSO eo eoutils) ###################################################################################### ### 6) Configure project installation paths ###################################################################################### -INSTALL(TARGETS BinaryPSO RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson6 COMPONENT examples) -INSTALL(TARGETS RealPSO RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson6 COMPONENT examples) +install(TARGETS BinaryPSO RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson6 COMPONENT examples) +install(TARGETS RealPSO RUNTIME DESTINATION local/share${INSTALL_SUB_DIR}/eo/examples/Lesson6 COMPONENT examples) ######################################################################################