Added install commands
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.0)
# Adding customized cmake module
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/")
@@ -14,9 +14,9 @@ include(BuildCLASS)
# Compilation flags
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang, disabling OpenMP support
- set(CMAKE_C_FLAGS "-O3 -fomit-frame-pointer -fno-common -fPIC")
+ set(CMAKE_C_FLAGS "-O3 -fomit-frame-pointer -fno-common -fPIC -D__CCL_DATA_DIR__=${CMAKE_INSTALL_PREFIX}/share/ccl")
else()
- set(CMAKE_C_FLAGS "-O3 -fomit-frame-pointer -fno-common -fPIC -fopenmp")
+ set(CMAKE_C_FLAGS "-O3 -fomit-frame-pointer -fno-common -fPIC -fopenmp -D__CCL_DATA_DIR__=${CMAKE_INSTALL_PREFIX}/share/ccl")
endif()
# Defines list of CCL src files
@@ -61,7 +61,7 @@ link_directories(${CLASS_LIBRARY_DIRS} ${GSL_LIBRARY_DIRS} ${FFTW_INCLUDE_DIRS})
include_directories(include)
# Builds the main CCL library
-add_library(ccl SHARED ${CCL_SRC})
+ add_library(ccl ${CCL_SRC})
add_dependencies(ccl CLASS)
if(NOT GSL_FOUND)
add_dependencies(ccl GSL)
@@ -71,3 +71,9 @@ target_link_libraries(ccl ${GSL_LIBRARIES} ${FFTW_LIBRARIES} ${CLASS_LIBRARIES}
# Builds the test suite
add_executable(check_ccl ${TEST_SRC})
target_link_libraries(check_ccl ccl)
+
+ # Installs CCL
+ install(TARGETS ccl DESTINATION lib)
+ install(DIRECTORY include/ DESTINATION include/
+ FILES_MATCHING PATTERN "*.h")
+ install(FILES include/ccl_params.ini DESTINATION share/ccl)
