diff --git a/CMakeLists.txt b/CMakeLists.txt index bab4819e..18f5f7ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -213,7 +213,7 @@ IF(VMIME_BUILD_STATIC_LIBRARY) ENDIF() # Installation of header files -INSTALL_HEADERS_WITH_DIRECTORY(VMIME_LIBRARY_INCLUDE_FILES headers "${CMAKE_SOURCE_DIR}/src/") +INSTALL_HEADERS_WITH_DIRECTORY(VMIME_LIBRARY_INCLUDE_FILES headers "${CMAKE_CURRENT_SOURCE_DIR}/src/") INSTALL_HEADERS_WITH_DIRECTORY(VMIME_LIBRARY_GENERATED_INCLUDE_FILES headers "${CMAKE_BINARY_DIR}/src") #INSTALL( @@ -242,12 +242,12 @@ IF(VMIME_BUILD_TESTS) FILE( GLOB_RECURSE VMIME_TESTS_SRC_FILES - ${CMAKE_SOURCE_DIR}/tests/*Test.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tests/*Test.cpp ) ADD_LIBRARY( test-runner - ${CMAKE_SOURCE_DIR}/tests/testRunner.cpp ${CMAKE_SOURCE_DIR}/tests/testUtils.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tests/testRunner.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/testUtils.cpp ) # Build one file for each test @@ -255,7 +255,7 @@ IF(VMIME_BUILD_TESTS) # "/path/to/vmime/tests/module/testFile.cpp" --> "module_testFile" GET_FILENAME_COMPONENT(VMIME_TEST_SRC_PATH "${VMIME_TEST_SRC_FILE}" PATH) - STRING(REPLACE "${CMAKE_SOURCE_DIR}" "" VMIME_TEST_SRC_PATH "${VMIME_TEST_SRC_PATH}") + STRING(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "" VMIME_TEST_SRC_PATH "${VMIME_TEST_SRC_PATH}") GET_FILENAME_COMPONENT(VMIME_TEST_NAME "${VMIME_TEST_SRC_FILE}" NAME_WE) SET(VMIME_TEST_NAME "${VMIME_TEST_SRC_PATH}/${VMIME_TEST_NAME}") STRING(REPLACE "/" "_" VMIME_TEST_NAME "${VMIME_TEST_NAME}") @@ -330,15 +330,15 @@ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION}") SET(CPACK_PACKAGE_VERSION "${VMIME_PACKAGE_VERSION}") # Package settings -SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING) +SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING) IF(APPLE) # CPack/PackageManager won't allow file without recognized extension # to be used as license file. - CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/COPYING" "${CMAKE_BINARY_DIR}/COPYING.txt" COPYONLY) + CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/COPYING" "${CMAKE_BINARY_DIR}/COPYING.txt" COPYONLY) SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/COPYING.txt") ELSE() - SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") + SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") ENDIF(APPLE) SET(CPACK_SOURCE_GENERATOR TGZ) @@ -372,7 +372,7 @@ ADD_CUSTOM_TARGET( dist COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2 - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) # PkgConfig @@ -1039,7 +1039,7 @@ IF(VMIME_BUILD_DOCUMENTATION) FIND_PACKAGE(Doxygen) IF(DOXYGEN_FOUND) - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile @ONLY) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile @ONLY) # Make a target so that documentation can be generated by running "make doc" ADD_CUSTOM_TARGET( @@ -1084,7 +1084,7 @@ ENDIF() CONFIGURE_FILE(cmake/config.hpp.cmake ${CMAKE_BINARY_DIR}/src/vmime/config.hpp) # PkgConfig post-configuration -CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/vmime.pc.in ${CMAKE_BINARY_DIR}/vmime.pc @ONLY) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/vmime.pc.in ${CMAKE_BINARY_DIR}/vmime.pc @ONLY) INSTALL(FILES ${CMAKE_BINARY_DIR}/vmime.pc DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig" COMPONENT headers) INCLUDE(CPack)