3 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0)
5 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fmessage-length=0 -Wdisabled-optimization")
9 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}")
10 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/AstroToolbox")
11 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/Functions/rng")
12 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/Functions/objfuns")
13 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/GOclasses/algorithms")
14 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/GOclasses/basic")
15 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/GOclasses/problems")
16 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/SolversThreads")
18 # Let's include Boost's headers.
19 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/external_headers")
21 # Suggested for multithreaded code.
22 ADD_DEFINITIONS(-D_REENTRANT)
24 SET(MANDATORY_LIBRARIES "")
26 CHECK_TYPE_SIZE("void *" POINTER_SIZE)
27 MESSAGE(STATUS "Pointer size = ${POINTER_SIZE}")
29 SET(PAGMO_LIB_SRC_LIST
30 ${CMAKE_SOURCE_DIR}/AstroToolbox/Astro_Functions.cpp
31 ${CMAKE_SOURCE_DIR}/AstroToolbox/Lambert.cpp
32 ${CMAKE_SOURCE_DIR}/AstroToolbox/mga.cpp
33 ${CMAKE_SOURCE_DIR}/AstroToolbox/mga_dsm.cpp
34 ${CMAKE_SOURCE_DIR}/AstroToolbox/misc4Tandem.cpp
35 ${CMAKE_SOURCE_DIR}/AstroToolbox/Pl_Eph_An.cpp
36 ${CMAKE_SOURCE_DIR}/AstroToolbox/PowSwingByInv.cpp
37 ${CMAKE_SOURCE_DIR}/AstroToolbox/propagateKEP.cpp
38 ${CMAKE_SOURCE_DIR}/AstroToolbox/time2distance.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
53 ADD_DEFINITIONS(-DBOOST_THREAD_BUILD_LIB)
54 SET(PAGMO_LIB_SRC_LIST ${PAGMO_LIB_SRC_LIST} boost_thread/tss_null.cpp)
56 SET(PAGMO_LIB_SRC_LIST ${PAGMO_LIB_SRC_LIST}
57 boost_thread/win32/exceptions.cpp
58 boost_thread/win32/thread.cpp
59 boost_thread/win32/tss_dll.cpp
60 boost_thread/win32/tss_pe.cpp
63 # If we are not in Windows, let's require pthread.
64 FIND_LIBRARY(PTHREAD_LIBRARY pthread)
65 IF(NOT PTHREAD_LIBRARY)
66 MESSAGE(FATAL_ERROR "pthread library not found, please specify manually where it is located.")
67 ENDIF(NOT PTHREAD_LIBRARY)
68 # TODO: check about the dl library here.
69 SET(MANDATORY_LIBRARIES ${MANDATORY_LIBRARIES} pthread)
70 SET(PAGMO_LIB_SRC_LIST ${PAGMO_LIB_SRC_LIST}
71 boost_thread/pthread/exceptions.cpp
72 boost_thread/pthread/once.cpp
73 boost_thread/pthread/thread.cpp
77 ADD_LIBRARY(pagmo STATIC ${PAGMO_LIB_SRC_LIST})
79 ADD_EXECUTABLE(main main.cpp)
81 TARGET_LINK_LIBRARIES(main pagmo ${MANDATORY_LIBRARIES})