Commit 46ba32aa authored by Tobias Lasser's avatar Tobias Lasser

Fix cmake config file install path (#37)

parent 0fdbde8b
Pipeline #205512 passed with stages
in 5 minutes and 9 seconds
......@@ -42,9 +42,6 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(DEFAULT_BUILD_TYPE "Release")
include(SetDefaultBuildType)
# set where to install the exports/targets
set(INSTALL_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/cmake)
# ------------ dependencies ------------
# ------------
......@@ -70,6 +67,13 @@ else()
message(STATUS " No dependencies added for elsa, as it is not stand-alone")
endif()
# set where to install the exports/targets
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(INSTALL_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/elsa)
# include the InstallElsaModule function
include(InstallElsaModule)
......
......@@ -74,15 +74,13 @@ install(FILES elsa.h
if(${ELSA_MASTER_PROJECT} AND ${ELSA_BUILD_WITH_MORE_WARNINGS})
list(REMOVE_ITEM ELSA_REGISTERED_COMPONENTS "")
foreach(_component ${ELSA_REGISTERED_COMPONENTS})
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
target_compile_options(elsa_${_component} PUBLIC -Wall -Wextra -Wconversion -pedantic -Wfatal-errors)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_options(elsa_${_component} PUBLIC /W3 /WX)
if (NOT(_component MATCHES "projector_kernels"))
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
target_compile_options(elsa_${_component} PUBLIC -Wall -Wextra -Wconversion -pedantic -Wfatal-errors)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_options(elsa_${_component} PUBLIC /W3 /WX)
endif()
endif()
endforeach(_component ELSA_REGISTERED_COMPONENTS)
endif()
# propagate the variable to the parent scope
set(ELSA_REGISTERED_COMPONENTS "${ELSA_REGISTERED_COMPONENTS};all;" PARENT_SCOPE)
......@@ -112,5 +112,8 @@ target_include_directories(${ELSA_MODULE_TARGET_NAME} PUBLIC
$<INSTALL_INTERFACE:include/elsa/${ELSA_MODULE_NAME}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
# register the module
registerComponent(${ELSA_MODULE_NAME})
# install the kernels as a module
InstallElsaModule(${ELSA_MODULE_NAME} ${ELSA_MODULE_TARGET_NAME} ${ELSA_MODULE_EXPORT_TARGET})
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment