These are chat archives for symengine/symengine

27th
Apr 2018
Björn Dahlgren
@bjodah
Apr 27 2018 14:37

I'm working on using CMake in a project of mine which relies on symengine, I noticed that the order in which I call find_package matters: symengine modifies CMAKE_MODULE_PATH:
this works:

message(STATUS "cmake_module_path = ${CMAKE_MODULE_PATH}")
find_package(SUNDIALS REQUIRED)
set(LIBS ${LIBS} ${SUNDIALS_LIBRARIES})

find_package(SymEngine 0.3.0 REQUIRED CONFIG)
set(LIBS ${LIBS} ${SYMENGINE_LIBRARIES})

with the output:

...
-- cmake_module_path = /path/to/myproject/cmake

Whereas if I reorder to call find_package on SymEngine first, the second step fails and the output is:

-- cmake_module_path = /opt/symengine-262478e/lib/cmake/symengine

I guess SymEngine's cmake scripts should either append to CMAKE_MODULE_PATH or keep a private(?) copy(?) of the variable? (sorry I'm still quite new to CMake so I might be doing something completely wrong here...)

(the problem that arises is that my FindSUNDIALS.cmake is not detected in the latter case)
Isuru Fernando
@isuruf
Apr 27 2018 15:12
@bjodah, that's a bug. Lines 51 and 58 in https://github.com/symengine/symengine/blob/master/cmake/SymEngineConfig.cmake.in should be removed