Skip to content

Commit

Permalink
Add find_dependency(Boost) to installed cmake config so that linkin…
Browse files Browse the repository at this point in the history
…g to Boost::Xyz libs works
  • Loading branch information
lkeegan committed Feb 15, 2024
1 parent d675a52 commit e0405f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/test_travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ cat >CMakeLists.txt <<'EOL'
cmake_minimum_required(VERSION 3.13)
project(expand1 LANGUAGES C CXX)
find_package(SymEngine CONFIG REQUIRED)
message(STATUS "${SYMENGINE_LIBRARIES}")
message(STATUS "${SYMENGINE_INCLUDE_DIRS}")
message(STATUS "SYMENGINE_LIBRARIES: ${SYMENGINE_LIBRARIES}")
message(STATUS "SYMENGINE_INCLUDE_DIRS: ${SYMENGINE_INCLUDE_DIRS}")
add_executable(expand1 expand1.cpp)
target_compile_features(expand1 PUBLIC cxx_std_14)
target_include_directories(expand1 PUBLIC ${SYMENGINE_INCLUDE_DIRS})
Expand Down
3 changes: 3 additions & 0 deletions cmake/SymEngineConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ if (POLICY CMP0057)
cmake_policy(SET CMP0057 NEW) # needed for llvm >= 16
endif ()

include(CMakeFindDependencyMacro)

set(SYMENGINE_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
set(SYMENGINE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
set(SYMENGINE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
Expand Down Expand Up @@ -101,6 +103,7 @@ endforeach()

#Use CMake provided find_package(BOOST) module
if (NOT "@Boost_INCLUDE_DIRS@" STREQUAL "")
find_dependency(Boost)
set(SYMENGINE_INCLUDE_DIRS ${SYMENGINE_INCLUDE_DIRS} @Boost_INCLUDE_DIRS@)
set(SYMENGINE_LIBRARIES ${SYMENGINE_LIBRARIES} @Boost_LIBRARIES@)
endif()
Expand Down

0 comments on commit e0405f5

Please sign in to comment.