-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
85 lines (70 loc) · 2.16 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 2.6)
PROJECT(galstar)
#
# Binary output directory
#
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
#
# Check requirements
#
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
### OpenMP support
find_package(OpenMP REQUIRED)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS})
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS})
#
# Intel Compiler Flags
#
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ipo -axHOST -no-prec-div ")
ELSE(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ffast-math ")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
### libpeyton
find_package(libpeyton REQUIRED)
include_directories(${libpeyton_INCLUDE_DIR})
### GSL
find_package(GSL REQUIRED)
include_directories(${GSL_INCLUDE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_INLINE=1 -DGSL_RANGE_CHECK=0")
### Boost
find_package(Boost REQUIRED COMPONENTS regex iostreams thread program_options)
include_directories(${Boost_INCLUDE_DIRS})
#
# Data Directories
#
set(DATADIRSUFFIX "share/${CMAKE_PROJECT_NAME}")
set(DATADIR "${CMAKE_INSTALL_PREFIX}/${DATADIRSUFFIX}")
#set(DATADIR "${PROJECT_SOURCE_DIR}")
#
# configure a header file to pass some of the CMake settings to the source
# code
#
configure_file(
"${PROJECT_SOURCE_DIR}/src/galstar_config.h.in"
"${PROJECT_BINARY_DIR}/src/galstar_config.h"
ESCAPE_QUOTES
)
include_directories("${PROJECT_BINARY_DIR}/src")
#
# libnpy (for writing numpy arrays)
#
#include_directories("/home/greg/projects/libnpy-0.5/include")
#
# galstar executable
#
add_executable(galstar src/main.cpp src/sampler.cpp src/binner.cpp src/stats.cpp src/interpolation.cpp src/chain.cpp)
target_link_libraries(galstar dl)
target_link_libraries(galstar ${Boost_LIBRARIES})
target_link_libraries(galstar ${CFITSIO_LIBRARIES})
target_link_libraries(galstar ${GSL_LIBRARIES})
target_link_libraries(galstar ${libpeyton_LIBRARIES})
#target_link_libraries(galstar "/home/greg/projects/libnpy-0.5/lib/libnpy.a")
#
# install info
#
install (TARGETS galstar DESTINATION bin)
install(FILES
data/MrLF.MSandRGB_v1.0.dat
data/MSandRGBcolors_v1.3.dat
DESTINATION ${DATADIRSUFFIX})