Skip to content
Snippets Groups Projects
Commit 184734a1 authored by Mederic Fourmy's avatar Mederic Fourmy
Browse files

Compiling a XXXConfig.cmake.in file

parent 74665f50
No related branches found
No related tags found
2 merge requests!8Cmake refactoring was merged to main, merge back to devel also,!7Resolve "Adapt to core CMakeLists.txt refactor"
......@@ -23,16 +23,8 @@ SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -D_REENTRANT")
#find dependencies
FIND_PACKAGE(Eigen3 3.3 REQUIRED)
FIND_PACKAGE(falkolib QUIET)
find_package(PkgConfig)
pkg_check_modules(csm QUIET csm )
message(WARNING ${csm_FOUND})
message(WARNING csm_LIBRARIES: ${csm_LIBRARIES})
message(WARNING csm_LIBRARY: ${csm_LIBRARY})
message(WARNING csm_LINK_LIBRARIES: ${csm_LINK_LIBRARIES})
message(WARNING csm_LIBRARY_DIRS: ${csm_LIBRARY_DIRS})
message(WARNING csm_INCLUDE_DIRS: ${csm_INCLUDE_DIRS})
message(WARNING csm_INCLUDE_DIR: ${csm_INCLUDE_DIR}) # NOPE!
#Build tests
......@@ -61,6 +53,37 @@ endif()
ADD_SUBDIRECTORY(src)
#install library
#=============================================================
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)
install(EXPORT ${PROJECT_NAME}Targets DESTINATION lib/${PROJECT_NAME}/cmake)
# Configure the package installation
include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_SOURCE_DIR}/cmake_modules/${PROJECT_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION ${LIB_INSTALL_DIR}/${PROJECT_NAME}/cmake
PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
DESTINATION
${LIB_INSTALL_DIR}/${PROJECT_NAME}/cmake
)
# Specifies include directories to use when compiling the plugin target
# This way, include_directories does not need to be called in plugins depending on this one
target_include_directories(${PROJECT_NAME} INTERFACE
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
)
#Build tests
IF(BUILD_TESTS)
# Enables testing for this directory and below.
......
set(@PROJECT_NAME@_VERSION 0.0.1)
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
check_required_components(@PROJECT_NAME@)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment