CMake improvements
Hi! The patchset at https://github.com/asheplyakov/ginac/tree/cmake (git pull git://github.com/asheplyakov/ginac.git cmake) makes it a bit easier to build and use GiNaC with CMake. In particular 1) one can build both GiNaC and CLN in one pass (without having to make install, figure out CFLAGS, LD_LIBRARY_PATH, etc): git clone -b cmake git://github.com/asheplyakov/ginac.git cd ginac git clone -b cmake git://github.com/asheplyakov/cln.git mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. make -j4 2) GiNaC can be included as CMake subproject: That is, to compile a program `derivative.cpp` (which uses GiNaC) one can download GiNaC sources into the `ginac` subdirectory (and CLN into ginac/cln subdirectory), and use the following CMakeLists.txt project(derivative) add_subdirectory(ginac) add_executable(derivative derivative.cpp) target_link_libraries(derivative ginac::ginac) # this adds both libraries and includes/defines 3) Targets are exported, so `find_package(ginac REQUIRED 1.7.0)` works "out of the box" (this requires CMake'ified CLN) Best regards, Alexey
Hi Alexey, On 23.08.20 11:03, Alexey Sheplyakov wrote:
https://github.com/asheplyakov/ginac/tree/cmake (git pull git://github.com/asheplyakov/ginac.git cmake)
I tried your patches. Some minor issues should still be addressed. 1) The file cmake/ginac-config.cmake.in ought to be shipped by Autotools, so CMake build works also with packages built with usual 'make dist'. What's the best way to do this? 2) Does the latest commit (4524434d27) break CMake build unless CLN is CMake'ified? I'm getting this: CMake Error at cmake/modules/FindCLN.cmake:141 (add_library): add_library cannot create ALIAS target "cln::cln" because target "cln" is imported but not globally visible. Call Stack (most recent call first): CMakeLists.txt:54 (find_package) 3) Commit 9b35ea74e2 breaks building the examples with -std=c++-20. Please remember to place using-declarations after #include directives, like in commit 69815a366b. All my best, -richy. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/>
Hi Richard, 23.08.2020, 18:00, "Richard B. Kreckel" <kreckel@in.terlu.de>:
1) The file cmake/ginac-config.cmake.in ought to be shipped by Autotools, so CMake build works also with packages built with usual 'make dist'. What's the best way to do this? 2) Does the latest commit (4524434d27) break CMake build unless CLN is CMake'ified? I'm getting this: CMake Error at cmake/modules/FindCLN.cmake:141 (add_library): add_library cannot create ALIAS target "cln::cln" because target "cln" is imported but not globally visible. Call Stack (most recent call first): CMakeLists.txt:54 (find_package)
3) Commit 9b35ea74e2 breaks building the examples with -std=c++-20. Please remember to place using-declarations after #include directives, like in commit 69815a366b.
I've addressed these issues and pushed updates to https://github.com/asheplyakov/ginac/tree/cmake (commit e7a1ce91cd311fde94a8011e2869a7f9fc018f41). Please let me know if there are any other problems. Best regards, Alexey
Dear Alexey, On 28.08.20 17:21, Alexey Sheplyakov wrote:
I've addressed these issues and pushed updates to https://github.com/asheplyakov/ginac/tree/cmake (commit e7a1ce91cd311fde94a8011e2869a7f9fc018f41). Please let me know if there are any other problems.
I just ran across one problem in doc/CMakeLists.txt. It tries to install an info file into into ${SHARE_INSTALL_PREFIX}, a variable which CMake doesn't seem to know. I've pushed a workaround but would appreciate if you could have a look. -richy. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/>
participants (2)
-
Alexey Sheplyakov
-
Richard B. Kreckel