Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake clean up: target specific include paths
Browse files Browse the repository at this point in the history
Peter Debacker committed Feb 6, 2023
1 parent 098160b commit 40cc7b0
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions sparta/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -10,23 +10,6 @@ set (GEN_DEBUG_INFO ON CACHE BOOL "Genearate debug info in compile & link -g")
set (SPARTA_BASE ${CMAKE_CURRENT_SOURCE_DIR})
include (${SPARTA_BASE}/cmake/sparta-config.cmake)

# Add RapidJSON
include_directories (SYSTEM ${RAPIDJSON_INCLUDE_DIRS})

# Add YAML CPP
include_directories (SYSTEM ${YAML_CPP_INCLUDE_DIR})

# Add local includes
include_directories ("./")
include_directories ("simdb/include")

# Add Boost (not typical system install)
include_directories (SYSTEM ${Boost_INCLUDE_DIRS})

# Add HDF5 (not typical system install)
include_directories (SYSTEM ${HDF5_C_INCLUDE_DIRS})
include_directories (SYSTEM ${HDF5_INCLUDE_DIRS})

# Add the source for libsparta.a
list (APPEND SourceCppFiles
src/ArgosOutputter.cpp
@@ -105,6 +88,25 @@ if (COMPILE_WITH_PYTHON)
python/sparta_support/Completer.cpp)
endif ()

add_library (sparta ${SourceCppFiles})

# Add RapidJSON
target_include_directories (sparta SYSTEM INTERFACE ${RAPIDJSON_INCLUDE_DIRS})

# Add YAML CPP
target_include_directories (sparta SYSTEM PRIVATE ${YAML_CPP_INCLUDE_DIR})

# Add local includes
target_include_directories (sparta PRIVATE "./")
target_include_directories (sparta INTERFACE "simdb/include")

# Add Boost (not typical system install)
target_include_directories (sparta SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})

# Add HDF5 (not typical system install)
target_include_directories (sparta SYSTEM INTERFACE ${HDF5_C_INCLUDE_DIRS})
target_include_directories (sparta SYSTEM INTERFACE ${HDF5_INCLUDE_DIRS})

execute_process (COMMAND bash "-c" "git describe --tags --always"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_REPO_VERSION RESULT_VARIABLE rc
@@ -215,7 +217,6 @@ set (CPPCHECK_EXCLUDES
)
find_package (Cppcheck)

add_library (sparta ${SourceCppFiles})
set (SPARTA_STATIC_LIBS ${PROJECT_BINARY_DIR}/libsparta.a)

# Build the SimDB library

0 comments on commit 40cc7b0

Please sign in to comment.