fix build system : make eo/edo tests work

This commit is contained in:
Johann Dreo 2012-10-07 19:48:15 +02:00
commit 06ff0b682b
17 changed files with 328 additions and 326 deletions

View file

@ -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)
######################################################################################