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

ENH: Refactor CMake project infrastructure #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RafaelPalomar
Copy link

This PR updates the cmake project definition for qRestAPI:

  • Removed old configuration and use CMake files in favor ofqRestAPIConfig.cmake.in
  • Enable install configuration through implementation of qRestAPIInstallConfig.cmake.in
  • Enabled installation of development files (optional).

This PR has been greatly inspired on the project definition for vtkAddon project. The motivation for this PR is to enable this library as a standalone library that can be installed and used in other projects and will be useful to build 3D Sclier with SUPERBUILD=OFF and support the SystoleOS.

Since these changes affect the cmake configuration files (most notably removing the need for UseqRestAPI.cmake file), projects using the library will need to update their cmake project definitions.

Installation examples

Library installation

cmake -S . -B build
❯ make install
[ 65%] Built target qRestAPI
[100%] Built target qRestAPITests
Install the project...
-- Install configuration: ""
-- Installing: /tmp/test-prefix/lib/qRestAPI/libqRestAPI.so
-- Installing: /tmp/test-prefix/cmake/qRestAPI/qRestAPIConfig.cmake

Library and development files installation

cmake -S . -B build -DqRestAPI_INSTALL_NO_DEVELOPMENT=OFF
❯ make install
[ 65%] Built target qRestAPI
[100%] Built target qRestAPITests
Install the project...
-- Install configuration: ""
-- Installing: /tmp/test-prefix/include/qRestAPI/qGirderAPI.h
-- Installing: /tmp/test-prefix/include/qRestAPI/qMidasAPI.h
-- Installing: /tmp/test-prefix/include/qRestAPI/qRestAPI.h
-- Installing: /tmp/test-prefix/include/qRestAPI/qRestAPI_p.h
-- Installing: /tmp/test-prefix/include/qRestAPI/qRestResult.h
-- Installing: /tmp/test-prefix/include/qRestAPI/qRestAPI_Export.h
-- Up-to-date: /tmp/test-prefix/lib/qRestAPI/libqRestAPI.so
-- Installing: /tmp/test-prefix/cmake/qRestAPI/qRestAPIConfig.cmake

content of install configuration:

❯ cat /tmp/test-prefix/cmake/qRestAPI/qRestAPIConfig.cmake
set(qRestAPI_CMAKE_DIR "/tmp/test-prefix/cmake/qRestAPI")
set(qRestAPI_INCLUDE_DIRS "/tmp/test-prefix/include/qRestAPI")
set(qRestAPI_LIB_DIR "/tmp/test-prefix/lib/qRestAPI")

- Removed old configuration and use CMake files in favor of`qRestAPIConfig.cmake.in`
- Enable install configuration through implementation of qRestAPIInstallConfig.cmake.in
- Enabled installation of development files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant