Check pointer size at build time to detect 64bit platform and locate automatically
[PaGMO.git] / CMakeLists.txt
blobc6abbce6de88a9d9edd39b9b0d191de70a676343
1 PROJECT(PaGMO)
2  
3 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0)
5 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fmessage-length=0 -Wdisabled-optimization")
6 SET(CMAKE_BUILD_TYPE "Release")
8 INCLUDE(CheckTypeSize)
10 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}")
11 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/AstroToolbox")
12 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/Functions/rng")
13 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/Functions/objfuns")
14 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/GOclasses/algorithms")
15 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/GOclasses/basic")
16 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/GOclasses/problems")
17 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/SolversThreads")
19 CHECK_TYPE_SIZE("void *" POINTER_SIZE)
20 MESSAGE(STATUS "Pointer size = ${POINTER_SIZE}")
22 FIND_LIBRARY(PTHREAD_LIBRARY pthread)
23 IF(NOT PTHREAD_LIBRARY)
24         MESSAGE(FATAL_ERROR "pthread library not found, please specify manually where it is located.")
25 ENDIF(NOT PTHREAD_LIBRARY)
27 SET(PAGMO_LIB_SRC_LIST
28         ${CMAKE_SOURCE_DIR}/AstroToolbox/Astro_Functions.cpp
29         ${CMAKE_SOURCE_DIR}/AstroToolbox/Lambert.cpp
30         ${CMAKE_SOURCE_DIR}/AstroToolbox/mga.cpp
31         ${CMAKE_SOURCE_DIR}/AstroToolbox/mga_dsm.cpp
32         ${CMAKE_SOURCE_DIR}/AstroToolbox/misc4Tandem.cpp
33         ${CMAKE_SOURCE_DIR}/AstroToolbox/Pl_Eph_An.cpp
34         ${CMAKE_SOURCE_DIR}/AstroToolbox/PowSwingByInv.cpp
35         ${CMAKE_SOURCE_DIR}/AstroToolbox/propagateKEP.cpp
36         ${CMAKE_SOURCE_DIR}/AstroToolbox/time2distance.cpp
37         ${CMAKE_SOURCE_DIR}/AstroToolbox/ZeroFinder.cpp
38         ${CMAKE_SOURCE_DIR}/Functions/rng/PkRandom.cpp
39         ${CMAKE_SOURCE_DIR}/Functions/objfuns/trajobjfuns.cpp
40         ${CMAKE_SOURCE_DIR}/GOclasses/algorithms/ASA.cpp
41         ${CMAKE_SOURCE_DIR}/GOclasses/algorithms/DE.cpp
42         ${CMAKE_SOURCE_DIR}/GOclasses/algorithms/MPSO.cpp
43         ${CMAKE_SOURCE_DIR}/GOclasses/algorithms/PSO.cpp
44         ${CMAKE_SOURCE_DIR}/GOclasses/algorithms/SGA.cpp
45         ${CMAKE_SOURCE_DIR}/GOclasses/basic/individual.cpp
46         ${CMAKE_SOURCE_DIR}/GOclasses/basic/population.cpp
47         ${CMAKE_SOURCE_DIR}/GOclasses/problems/GOproblem.cpp
48         ${CMAKE_SOURCE_DIR}/GOclasses/problems/TrajectoryProblems.cpp
49         ${CMAKE_SOURCE_DIR}/SolversThreads/SolversThreads.cpp
52 ADD_LIBRARY(pagmo STATIC ${PAGMO_LIB_SRC_LIST})
54 ADD_EXECUTABLE(main main.cpp)
56 TARGET_LINK_LIBRARIES(main pagmo ${PTHREAD_LIBRARY})