Commit 69ddb006 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Update install process

parent c7d9280d
......@@ -66,7 +66,7 @@ if(NOT DEFINED SPETABARU_JUST_LIB)
endif()
if(NOT DEFINED SPETABARU_DO_INSTALL)
set(SPETABARU_DO_INSTALL OFF CACHE BOOL
set(SPETABARU_DO_INSTALL ON CACHE BOOL
"Set to on to install the headers file of SPETABARU" FORCE)
endif()
......
set(SPETABARU_CXX_FLAGS @SPETABARU_CXX_FLAGS@)
set(SPETABARU_BINARY_DIR @SPETABARU_BINARY_DIR@)
set(SPETABARU_SOURCE_DIR @SPETABARU_SOURCE_DIR@)
set(SPETABARU_INCLUDE_DIR @SPETABARU_INCLUDE_DIR@)
......@@ -12,21 +12,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
)
file(
GLOB_RECURSE
hpp_in_dir
./*.hpp ./*.h
)
FOREACH(hpp_file ${hpp_in_dir})
file(RELATIVE_PATH relative_hpp_file ${CMAKE_CURRENT_SOURCE_DIR} ${hpp_file})
if(SPETABARU_DO_INSTALL)
INSTALL( FILES ${hpp_file} DESTINATION include/${relative_hpp_file} )
endif()
if($ENV{VERBOSE})
MESSAGE(STATUS "Src -- Add ${relative_hpp_file}")
endif()
ENDFOREACH()
INSTALL(DIRECTORY ./ DESTINATION include/ )
if(SPETABARU_DO_INSTALL)
INSTALL( FILES "${SPETABARU_BINARY_DIR}/Src/SPETABARUConfig.h" DESTINATION include/Src )
......@@ -34,11 +20,7 @@ endif()
# Searching all cpp file
file(
GLOB_RECURSE
source_lib_files
./*.cpp
)
file(GLOB_RECURSE source_lib_files ./*.cpp)
# Adding cpp files to project
add_library(
......@@ -46,3 +28,9 @@ add_library(
${source_lib_files}
)
if(SPETABARU_DO_INSTALL)
target_include_directories(spetabaru INTERFACE $<INSTALL_INTERFACE:include>)
INSTALL(TARGETS spetabaru EXPORT spetabaru DESTINATION lib )
INSTALL(EXPORT spetabaru DESTINATION lib )
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment