Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install vendored cereal headers #1867

Merged
merged 1 commit into from Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions CMakeLists.txt
Expand Up @@ -313,12 +313,14 @@ if (WITH_MPC)
set(PKGS ${PKGS} "MPC")
endif()

set(WITH_SYSTEM_CEREAL no CACHE BOOL "Build with system cereal instead of vendored files")
if (WITH_SYSTEM_CEREAL)
find_package(CEREAL REQUIRED)
include_directories(SYSTEM ${CEREAL_INCLUDE_DIRS})
set(PKGS ${PKGS} "CEREAL")
else()
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/symengine/utilities/cereal/include)
set(CEREAL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/symengine/utilities/cereal/include")
endif()
include_directories(SYSTEM ${CEREAL_INCLUDE_DIRS})

# PTHREAD
set(WITH_PTHREAD no
Expand Down Expand Up @@ -615,6 +617,9 @@ if (TARGET teuchos)
set(CONF_INCLUDE_DIRS ${CONF_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/symengine/utilities/teuchos ${PROJECT_BINARY_DIR}/symengine/utilities/teuchos)
endif()
if (NOT WITH_SYSTEM_CEREAL)
set(CONF_INCLUDE_DIRS ${CONF_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/symengine/utilities/cereal/include)
endif()
set(SYMENGINE_BUILD_TREE yes)
configure_file(cmake/SymEngineConfig.cmake.in
"${PROJECT_BINARY_DIR}/SymEngineConfig.cmake" @ONLY)
Expand Down
7 changes: 6 additions & 1 deletion cmake/SymEngineConfig.cmake.in
Expand Up @@ -54,13 +54,18 @@ if(SYMENGINE_BUILD_TREE)
set(SYMENGINE_INSTALL_CMAKE_DIR "${SYMENGINE_CMAKE_DIR}")
set(SYMENGINE_INCLUDE_DIRS @CONF_INCLUDE_DIRS@ ${SYMENGINE_CMAKE_DIR})
if (TARGET teuchos)
set(SYMENGINE_INCLUDE_DIRS ${SYMENGINE_INCLUDE_DIRS} ${SYMENGINE_CMAKE_DIR}/symengine/teuchos)
set(SYMENGINE_INCLUDE_DIRS ${SYMENGINE_INCLUDE_DIRS} ${SYMENGINE_CMAKE_DIR}/symengine/utilities/teuchos)
endif()
else()
set(SYMENGINE_INSTALL_CMAKE_DIR "@CMAKE_INSTALL_PREFIX@/@INSTALL_CMAKE_DIR@")
set(SYMENGINE_INCLUDE_DIRS "${SYMENGINE_CMAKE_DIR}/@DEF_INSTALL_CMAKE_DIR_REL@/include")
if (NOT @WITH_SYSTEM_CEREAL@)
set(SYMENGINE_INCLUDE_DIRS ${SYMENGINE_INCLUDE_DIRS}
"${SYMENGINE_CMAKE_DIR}/@DEF_INSTALL_CMAKE_DIR_REL@/include/symengine/utilities/cereal/include")
endif()
endif()


@SYMENGINE_PKG_FINDS@

set(SYMENGINE_LLVM_COMPONENTS @SYMENGINE_LLVM_COMPONENTS@)
Expand Down
6 changes: 6 additions & 0 deletions symengine/CMakeLists.txt
Expand Up @@ -224,8 +224,14 @@ set(HEADERS
assumptions.h
refine.h
simplify.h
utilities/stream_fmt.h
)

if (NOT WITH_SYSTEM_CEREAL)
file(GLOB_RECURSE CEREAL_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "utilities/cereal/include/*")
set(HEADERS ${HEADERS} ${CEREAL_HEADERS})
endif()

include(GNUInstallDirs)

# Configure SymEngine using our CMake options:
Expand Down