Use "modern" CMake facilities to manage includes and libs
authorAlexey Sheplyakov <asheplyakov@altlinux.org>
Wed, 18 Dec 2019 10:52:17 +0000 (14:52 +0400)
committerAlexey Sheplyakov <asheplyakov@altlinux.org>
Fri, 28 Aug 2020 15:15:31 +0000 (19:15 +0400)
commit4f71d7035d32e8f74d9b13e0d6a9c0ab4a58062d
treeb2fef43942943c67c31beea8782fe903c55a6147
parentf7ffc0186d90947cb5df395b9fc547ab80115ea0
Use "modern" CMake facilities to manage includes and libs

* Use target_link_libraries to specify dependencies (include paths,
  compiler options, etc)

* Export targets and provide `ginac-config.cmake` so the following
  `CMakeLists.txt` is enough to build a program using GiNaC:

    cmake_minimum_required(VERSION 3.1)
    project(foo)
    find_package(ginac REQUIRED)
    add_executable(foo foo.cpp)
    target_link_libraries(foo PRIVATE ginac::ginac)

* GiNaC can be included as a (CMake) subproject. One can put GiNaC
  sources (either from git or a tarball) into a subdirectory (say,
  `ginac`) and use the following CMakeLists.txt to build everything:

    cmake_minimum_required(VERSION 3.1)
    project(foo)
    add_subdirectory(ginac)
    add_executable(foo foo.cpp)
    target_link_libraries(foo PRIVATE ginac::ginac)
CMakeLists.txt
Makefile.am
check/CMakeLists.txt
cmake/ginac-config.cmake.in [new file with mode: 0644]
cmake/modules/FindCLN.cmake
doc/examples/CMakeLists.txt
ginac.pc.cmake
ginac/CMakeLists.txt
ginsh/CMakeLists.txt
tools/CMakeLists.txt