update installation scripts

This commit is contained in:
lganzzzo 2019-01-28 18:16:07 +02:00
parent df1a55fd61
commit c85dae66ac
2 changed files with 8 additions and 4 deletions

View File

@ -1,9 +1,11 @@
@PACKAGE_INIT@
if(NOT TARGET oatpp::oatpp)
if(NOT TARGET oatpp::@OATPP_MODULE_NAME@)
include("${CMAKE_CURRENT_LIST_DIR}/@OATPP_MODULE_NAME@Targets.cmake")
endif()
set_and_check(@OATPP_MODULE_NAME@_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/oatpp-@OATPP_MODULE_VERSION@/@OATPP_MODULE_NAME@/")
set_and_check(@OATPP_MODULE_NAME@_LIBRARIES_DIRS "${PACKAGE_PREFIX_DIR}/lib/@OATPP_MODULE_NAME@-@OATPP_MODULE_VERSION@/")
set_and_check(@OATPP_MODULE_NAME@_LIBRARIES_DIRS "${PACKAGE_PREFIX_DIR}/@OATPP_MODULE_LIBDIR@/oatpp-@OATPP_MODULE_VERSION@/")
set(@OATPP_MODULE_NAME@_LIBRARIES @OATPP_MODULE_LIBRARIES@)
set(OATPP_BASE_DIR "${PACKAGE_PREFIX_DIR}/include/oatpp-@OATPP_MODULE_VERSION@/")

View File

@ -37,12 +37,15 @@ message("\n#####################################################################
## Set cache variables to configure module-config.cmake.in template
## via call to configure_package_config_file
include(GNUInstallDirs)
set(OATPP_MODULE_NAME ${OATPP_THIS_MODULE_NAME} CACHE STRING "oatpp module name")
set(OATPP_MODULE_VERSION "${OATPP_THIS_MODULE_VERSION}" CACHE STRING "oatpp module version")
set(OATPP_MODULE_LIBRARIES
"${OATPP_THIS_MODULE_LIBRARIES}" ## list libraries to find when find_package is called
CACHE INTERNAL "oatpp module libraries"
)
set(OATPP_MODULE_LIBDIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING "lib folder name")
#######################################################################################
## calc directories to install (relative to this script)
@ -54,8 +57,6 @@ endforeach()
#######################################################################################
include(GNUInstallDirs)
install(TARGETS ${OATPP_THIS_MODULE_TARGETS}
EXPORT "${OATPP_MODULE_NAME}Targets"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/oatpp-${OATPP_MODULE_VERSION}"
@ -93,6 +94,7 @@ configure_package_config_file(
OATPP_MODULE_NAME
OATPP_MODULE_VERSION
OATPP_MODULE_LIBRARIES
OATPP_MODULE_LIBDIR
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)