This repository has been archived on 2026-03-28. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
eodev/eo/tutorial/Lesson1/CMakeLists.txt
2011-05-05 17:15:10 +02:00

64 lines
2.8 KiB
CMake

######################################################################################
### 1) Include the sources
######################################################################################
INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/ga)
INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/utils)
######################################################################################
### 2) Specify where CMake can find the libraries
######################################################################################
IF(NOT WIN32 OR CYGWIN)
LINK_DIRECTORIES(${EO_BINARY_DIR}/lib)
ENDIF(NOT WIN32 OR CYGWIN)
# especially for Visual Studio
IF(WIN32 AND NOT CYGWIN)
LINK_DIRECTORIES(${EO_BINARY_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_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(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}")
######################################################################################
### 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)
######################################################################################
### 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)
######################################################################################