From 541a14babff45c4f616184d770f508cd43de709b Mon Sep 17 00:00:00 2001 From: Caner Candan Date: Wed, 1 Sep 2010 17:30:50 +0200 Subject: [PATCH] * packaging: now the test and tutorial binaries are installed in share directory --- eo/Packaging.cmake | 16 +++- eo/test/CMakeLists.txt | 132 +++++++++++++++-------------- eo/tutorial/Lesson1/CMakeLists.txt | 7 ++ eo/tutorial/Lesson2/CMakeLists.txt | 8 ++ eo/tutorial/Lesson3/CMakeLists.txt | 8 ++ eo/tutorial/Lesson4/CMakeLists.txt | 8 ++ eo/tutorial/Lesson5/CMakeLists.txt | 7 ++ eo/tutorial/Lesson6/CMakeLists.txt | 7 ++ 8 files changed, 127 insertions(+), 66 deletions(-) diff --git a/eo/Packaging.cmake b/eo/Packaging.cmake index 7bdaa5de1..c9e2d44b1 100644 --- a/eo/Packaging.cmake +++ b/eo/Packaging.cmake @@ -17,13 +17,23 @@ ENDIF() ### 2) Set up components ###################################################################################### -SET(CPACK_COMPONENTS_ALL libraries) -SET(CPACK_ALL_INSTALL_TYPES Full) +SET(CPACK_COMPONENTS_ALL libraries test examples) +SET(CPACK_ALL_INSTALL_TYPES Minimal Full) SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "${PACKAGE_NAME}") SET(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "${PACKAGE_NAME} library") SET(CPACK_COMPONENT_LIBRARIES_GROUP "Devel") -SET(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Full) +SET(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Minimal Full) + +SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "${PACKAGE_NAME}") +SET(CPACK_COMPONENT_TEST_DESCRIPTION "${PACKAGE_NAME} test") +SET(CPACK_COMPONENT_TEST_GROUP "Devel") +SET(CPACK_COMPONENT_TEST_INSTALL_TYPES Full) + +SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "${PACKAGE_NAME}") +SET(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "${PACKAGE_NAME} examples") +SET(CPACK_COMPONENT_EXAMPLES_GROUP "Devel") +SET(CPACK_COMPONENT_EXAMPLES_INSTALL_TYPES Full) ###################################################################################### diff --git a/eo/test/CMakeLists.txt b/eo/test/CMakeLists.txt index e9ecce708..cc4becdb1 100644 --- a/eo/test/CMakeLists.txt +++ b/eo/test/CMakeLists.txt @@ -24,72 +24,78 @@ LINK_DIRECTORIES(${EO_BINARY_DIR}/lib) ### 3) Define your targets and link the librairies ###################################################################################### -SET (TEST_LIST t-eoParetoFitness - t-eoPareto - t-eofitness - t-eoRandom - t-eobin - t-eoVirus - t-MGE - t-MGE1bit - t-MGE-control - t-eoStateAndParser - t-eoCheckpointing - t-eoSSGA - t-eoExternalEO - t-eoSymreg - t-eo - t-eoReplacement - t-eoSelect - t-eoGenOp - t-eoGA - t-eoReal - t-eoVector - t-eoESAll - t-eoPBIL - t-eoFitnessAssembled - t-eoFitnessAssembledEA - t-eoRoulette - t-eoSharing - t-eoCMAES - t-eoSecondsElapsedContinue - t-eoRNG - t-eoEasyPSO - t-eoNSGA - t-eoInt - t-eoInitPermutation - t-eoSwapMutation - t-eoShiftMutation - t-eoTwoOptMutation - t-eoRingTopology - t-eoSyncEasyPSO - t-eoOrderXover - t-eoExtendedVelocity - # t-eoFrontSorter - # t-eoEpsMOEA - t-eoLogger - ) - +SET (TEST_LIST + t-eoParetoFitness + t-eoPareto + t-eofitness + t-eoRandom + t-eobin + t-eoVirus + t-MGE + t-MGE1bit + t-MGE-control + t-eoStateAndParser + t-eoCheckpointing + t-eoSSGA + t-eoExternalEO + t-eoSymreg + t-eo + t-eoReplacement + t-eoSelect + t-eoGenOp + t-eoGA + t-eoReal + t-eoVector + t-eoESAll + t-eoPBIL + t-eoFitnessAssembled + t-eoFitnessAssembledEA + t-eoRoulette + t-eoSharing + t-eoCMAES + t-eoSecondsElapsedContinue + t-eoRNG + t-eoEasyPSO + t-eoNSGA + t-eoInt + t-eoInitPermutation + t-eoSwapMutation + t-eoShiftMutation + t-eoTwoOptMutation + t-eoRingTopology + t-eoSyncEasyPSO + t-eoOrderXover + t-eoExtendedVelocity + # t-eoFrontSorter + # t-eoEpsMOEA + t-eoLogger + ) + + FOREACH (test ${TEST_LIST}) - SET ("T_${test}_SOURCES" "${test}.cpp") + SET ("T_${test}_SOURCES" "${test}.cpp") ENDFOREACH (test) 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 eomoo) - ENDFOREACH (mintest) - -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 eomoo) - ENDFOREACH (test) -ENDIF(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 eomoo) + ENDFOREACH (mintest) + +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 eomoo) + INSTALL(TARGETS ${test} RUNTIME DESTINATION share/eo/test COMPONENT test) + ENDFOREACH (test) + +ENDIF(ENABLE_MINIMAL_CMAKE_TESTING) + +###################################################################################### diff --git a/eo/tutorial/Lesson1/CMakeLists.txt b/eo/tutorial/Lesson1/CMakeLists.txt index 346bede15..614b8421a 100644 --- a/eo/tutorial/Lesson1/CMakeLists.txt +++ b/eo/tutorial/Lesson1/CMakeLists.txt @@ -53,5 +53,12 @@ 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 share/eo/examples/Lesson1 COMPONENT examples) +INSTALL(TARGETS FirstRealGA RUNTIME DESTINATION share/eo/examples/Lesson1 COMPONENT examples) +INSTALL(TARGETS exercise1.3 RUNTIME DESTINATION share/eo/examples/Lesson1 COMPONENT examples) + +###################################################################################### diff --git a/eo/tutorial/Lesson2/CMakeLists.txt b/eo/tutorial/Lesson2/CMakeLists.txt index 6eefc5ca3..db3e0e98c 100644 --- a/eo/tutorial/Lesson2/CMakeLists.txt +++ b/eo/tutorial/Lesson2/CMakeLists.txt @@ -50,3 +50,11 @@ 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 share/eo/examples/Lesson2 COMPONENT examples) +INSTALL(TARGETS FirstRealEA RUNTIME DESTINATION share/eo/examples/Lesson2 COMPONENT examples) +INSTALL(TARGETS exercise2.3 RUNTIME DESTINATION share/eo/examples/Lesson2 COMPONENT examples) + +###################################################################################### diff --git a/eo/tutorial/Lesson3/CMakeLists.txt b/eo/tutorial/Lesson3/CMakeLists.txt index 836df97d1..b3e7c0a78 100644 --- a/eo/tutorial/Lesson3/CMakeLists.txt +++ b/eo/tutorial/Lesson3/CMakeLists.txt @@ -54,4 +54,12 @@ 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 share/eo/examples/Lesson3 COMPONENT examples) +INSTALL(TARGETS SecondRealEA RUNTIME DESTINATION share/eo/examples/Lesson3 COMPONENT examples) +INSTALL(TARGETS exercise3.1 RUNTIME DESTINATION share/eo/examples/Lesson3 COMPONENT examples) + +###################################################################################### diff --git a/eo/tutorial/Lesson4/CMakeLists.txt b/eo/tutorial/Lesson4/CMakeLists.txt index d2f1a5199..20e0cde43 100644 --- a/eo/tutorial/Lesson4/CMakeLists.txt +++ b/eo/tutorial/Lesson4/CMakeLists.txt @@ -88,4 +88,12 @@ 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 share/eo/examples/Lesson4 COMPONENT examples) +INSTALL(TARGETS RealEA RUNTIME DESTINATION share/eo/examples/Lesson4 COMPONENT examples) +INSTALL(TARGETS ESEA RUNTIME DESTINATION share/eo/examples/Lesson4 COMPONENT examples) + +###################################################################################### diff --git a/eo/tutorial/Lesson5/CMakeLists.txt b/eo/tutorial/Lesson5/CMakeLists.txt index 8a2eb1033..224552e3f 100644 --- a/eo/tutorial/Lesson5/CMakeLists.txt +++ b/eo/tutorial/Lesson5/CMakeLists.txt @@ -47,3 +47,10 @@ 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 share/eo/examples/Lesson5 COMPONENT examples) +INSTALL(TARGETS OneMaxLibEA RUNTIME DESTINATION share/eo/examples/Lesson5 COMPONENT examples) + +###################################################################################### diff --git a/eo/tutorial/Lesson6/CMakeLists.txt b/eo/tutorial/Lesson6/CMakeLists.txt index 4d967d717..b1e414537 100644 --- a/eo/tutorial/Lesson6/CMakeLists.txt +++ b/eo/tutorial/Lesson6/CMakeLists.txt @@ -42,4 +42,11 @@ TARGET_LINK_LIBRARIES(BinaryPSO eo eoutils) TARGET_LINK_LIBRARIES(RealPSO eo eoutils) ###################################################################################### +### 6) Configure project installation paths +###################################################################################### + +INSTALL(TARGETS BinaryPSO RUNTIME DESTINATION share/eo/examples/Lesson6 COMPONENT examples) +INSTALL(TARGETS RealPSO RUNTIME DESTINATION share/eo/examples/Lesson6 COMPONENT examples) + +######################################################################################