From e3c565ce27664969f8fb14f680ec39917f18079a Mon Sep 17 00:00:00 2001 From: "Dipl.-Ing. Jonas Stienen" Date: Wed, 18 Apr 2018 15:45:20 +0200 Subject: [PATCH] Replacing cmake source variables with cmake CURRENT source variables for correct relative paths when libcitygml is not build from the original CMakeLists but as a subdirectory --- CMakeLists.txt | 4 ++-- osgplugin/CMakeLists.txt | 2 +- sources/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3d5f925..19f31932 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(META_VERSION_PATCH "8") set(META_VERSION "${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH}") -SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" ) +SET( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" ) IF(WIN32) @@ -197,7 +197,7 @@ IF(UNIX AND NOT APPLE) set(CPACK_PACKAGE_VERSION_MAJOR "${META_VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${META_VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${META_VERSION_PATCH}") - set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_PACKAGE_RELOCATABLE OFF) # Debian package information diff --git a/osgplugin/CMakeLists.txt b/osgplugin/CMakeLists.txt index 1bc3ade5..c4cbf2a4 100644 --- a/osgplugin/CMakeLists.txt +++ b/osgplugin/CMakeLists.txt @@ -5,7 +5,7 @@ find_package( OpenSceneGraph REQUIRED osgDB osgViewer osgGA osgUtil osgText) include_directories( ${OPENSCENEGRAPH_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/sources/include + ${CMAKE_CURRENT_SOURCE_DIR}/../sources/include ) set( sources ReaderWriterCityGML.cpp ) diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index 3b4d9d25..eb7480a0 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -1,7 +1,7 @@ include(GenerateExportHeader) IF (NOT DEFINED CMAKE_MODULE_PATH) - GET_FILENAME_COMPONENT(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../CMakeModules" ABSOLUTE) + GET_FILENAME_COMPONENT(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../CMakeModules" ABSOLUTE) ENDIF (NOT DEFINED CMAKE_MODULE_PATH) SET( target citygml ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5c2271c3..31026369 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,7 +12,7 @@ ELSE( LIBCITYGML_DYNAMIC ) ENDIF( LIBCITYGML_DYNAMIC ) # INCLUDE_DIRECTORIES( ${CITYGML_INCLUDE_DIR} ) -INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/sources/include ${CMAKE_BINARY_DIR}/sources/include) +INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../sources/include ${CMAKE_BINARY_DIR}/sources/include) SET( PRG_SRCS citygmltest.cpp )