Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Context not available. | |||||
30 | 30 | | |||
---|---|---|---|---|---|
31 | kde_target_enable_exceptions(alkimia PUBLIC) | 31 | kde_target_enable_exceptions(alkimia PUBLIC) | ||
32 | 32 | | |||
33 | target_include_directories(alkimia PUBLIC ${GMP_INCLUDE_DIR}) | | |||
34 | target_link_libraries(alkimia PUBLIC ${QT_USE_LIBSPREFIX}Core ${QT_USE_LIBSPREFIX}DBus ${GMP_LIBRARIES}) | | |||
35 | generate_export_header(alkimia BASE_NAME alk) | 33 | generate_export_header(alkimia BASE_NAME alk) | ||
36 | 34 | | |||
37 | set_target_properties(alkimia PROPERTIES VERSION ${ALKIMIA_LIB_VERSION} SOVERSION ${ALKIMIA_LIB_SOVERSION}) | 35 | set_target_properties(alkimia PROPERTIES VERSION ${ALKIMIA_LIB_VERSION} SOVERSION ${ALKIMIA_LIB_SOVERSION}) | ||
38 | set_target_properties(alkimia PROPERTIES OUTPUT_NAME alkimia${ALKIMIA_LIB_SUFFIX}) | 36 | set_target_properties(alkimia PROPERTIES OUTPUT_NAME alkimia${ALKIMIA_LIB_SUFFIX}) | ||
39 | set(INCLUDE_INSTALL_DIR include/alkimia/${ALKIMIA_INCLUDE_SUFFIX}) | 37 | set(INCLUDE_INSTALL_DIR include/alkimia/${ALKIMIA_INCLUDE_SUFFIX}) | ||
40 | 38 | | |||
39 | target_include_directories(alkimia PUBLIC "$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>" ${GMP_INCLUDE_DIR}) | ||||
christiand: The `${GMP_INCLUDE_DIR}` cannot be used as Public here because it inserts an absolute path. | |||||
habacker: > This absolute file path changes with a high chance
and on Windows also | |||||
see https://cmake.org/cmake/help/v3.0/module/CMakeFindDependencyMacro.html for more details habacker: > instead added again in the LibAlkimiaConfig after the required use of find_dependency(GMP)… | |||||
40 | target_link_libraries(alkimia PUBLIC ${QT_USE_LIBSPREFIX}Core ${QT_USE_LIBSPREFIX}DBus ${GMP_LIBRARIES}) | ||||
christiand: Same here for `${GMP_LIBRARIES}`. | |||||
41 | | ||||
41 | if (NOT WIN32) | 42 | if (NOT WIN32) | ||
42 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libalkimia.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libalkimia${ALKIMIA_PATH_SUFFIX}.pc IMMEDIATE @ONLY) | 43 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libalkimia.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libalkimia${ALKIMIA_PATH_SUFFIX}.pc IMMEDIATE @ONLY) | ||
43 | endif(NOT WIN32) | 44 | endif(NOT WIN32) | ||
Context not available. |
The ${GMP_INCLUDE_DIR} cannot be used as Public here because it inserts an absolute path. This absolute file path changes with a high chance (e.g. in deb or rpm creating environments vs the system it is installed on). It must be kept in a $<BUILD_INTERFACE:...> and instead added again in the LibAlkimiaConfig after the required use of find_dependency(GMP) (which updates the paths accordingly to the current enviroment).
Alternatively targets have to be added to FindGMP.cmake. Then the hole handling of variables is not required at all.