diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index d4c4944e4..75ba20af2 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -54,9 +54,9 @@ set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt") set(CPACK_NSIS_MODIFY_PATH ON) -set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources\\\\FreeRDP_Install.bmp") -set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/resources\\\\FreeRDP_Icon_96px.ico") -set(CPACK_NSIS_MUI_UNICON "${CMAKE_SOURCE_DIR}/resource\\\\FreeRDP_Icon_96px.ico") +set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/resources\\\\FreeRDP_Install.bmp") +set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/resources\\\\FreeRDP_Icon_96px.ico") +set(CPACK_NSIS_MUI_UNICON "${PROJECT_SOURCE_DIR}/resource\\\\FreeRDP_Icon_96px.ico") set(CPACK_COMPONENTS_ALL client server libraries headers symbols tools) @@ -93,8 +93,8 @@ set(CPACK_COMPONENT_GROUP_RUNTIME_DESCRIPTION "Runtime") set(CPACK_COMPONENT_GROUP_APPLICATIONS_DESCRIPTION "Applications") set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "Development") -configure_file("${CMAKE_SOURCE_DIR}/CMakeCPackOptions.cmake.in" - "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY) -set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake") +configure_file("${PROJECT_SOURCE_DIR}/CMakeCPackOptions.cmake.in" + "${PROJECT_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY) +set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CMakeCPackOptions.cmake") include(CPack) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd368c431..398eb94c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ set(CMAKE_COLOR_MAKEFILE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Include our extra modules -set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) +set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/) if((CMAKE_SYSTEM_NAME MATCHES "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES "10.0")) set(UWP 1) @@ -81,8 +81,8 @@ endif() set(WITH_LIBRARY_VERSIONING "ON") set(RAW_VERSION_STRING "3.0.0-dev") -if(EXISTS "${CMAKE_SOURCE_DIR}/.source_tag") - file(READ ${CMAKE_SOURCE_DIR}/.source_tag RAW_VERSION_STRING) +if(EXISTS "${PROJECT_SOURCE_DIR}/.source_tag") + file(READ ${PROJECT_SOURCE_DIR}/.source_tag RAW_VERSION_STRING) elseif(USE_VERSION_FROM_GIT_TAG) git_get_exact_tag(_GIT_TAG --tags --always) if (NOT ${_GIT_TAG} STREQUAL "n/a") @@ -134,8 +134,8 @@ if(CCACHE AND WITH_CCACHE) endif(NOT DEFINED CMAKE_C_COMPILER_LAUNCHER) endif(CCACHE AND WITH_CCACHE) -if(EXISTS "${CMAKE_SOURCE_DIR}/.source_version" ) - file(READ ${CMAKE_SOURCE_DIR}/.source_version GIT_REVISION) +if(EXISTS "${PROJECT_SOURCE_DIR}/.source_version" ) + file(READ ${PROJECT_SOURCE_DIR}/.source_version GIT_REVISION) string(STRIP ${GIT_REVISION} GIT_REVISION) else() @@ -296,7 +296,7 @@ if (CMAKE_GENERATOR MATCHES "Unix Makefile*") string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE) CHECK_C_COMPILER_FLAG (-Wno-builtin-macro-redefined Wno-builtin-macro-redefined) if(Wno-builtin-macro-redefined) - set(CMAKE_C_FLAGS_${UPPER_BUILD_TYPE} "${CMAKE_C_FLAGS_${UPPER_BUILD_TYPE}} -Wno-builtin-macro-redefined -D__FILE__='\"$(subst ${CMAKE_BINARY_DIR}/,,$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<)))\"'") + set(CMAKE_C_FLAGS_${UPPER_BUILD_TYPE} "${CMAKE_C_FLAGS_${UPPER_BUILD_TYPE}} -Wno-builtin-macro-redefined -D__FILE__='\"$(subst ${PROJCET_BINARY_DIR}/,,$(subst ${PROJECT_SOURCE_DIR}/,,$(abspath $<)))\"'") endif() endif() endif() @@ -339,11 +339,11 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCC) endif() set(CMAKE_REQUIRED_LINK_OPTIONS_SAVED ${CMAKE_REQUIRED_LINK_OPTIONS}) - file(WRITE ${CMAKE_BINARY_DIR}/foo.txt "") + file(WRITE ${PROJECT_BINARY_DIR}/foo.txt "") if(WITH_SANITIZE_ADDRESS) list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-fsanitize=address") CHECK_C_COMPILER_FLAG ("-fsanitize=address" fsanitize-address) - CHECK_C_COMPILER_FLAG ("-fsanitize-blacklist=${CMAKE_BINARY_DIR}/foo.txt" fsanitize-blacklist) + CHECK_C_COMPILER_FLAG ("-fsanitize-blacklist=${PROJECT_BINARY_DIR}/foo.txt" fsanitize-blacklist) CHECK_C_COMPILER_FLAG ("-fsanitize-address-use-after-scope" fsanitize-address-use-after-scope) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") @@ -351,7 +351,7 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") if(fsanitize-blacklist) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/scripts/blacklist-address-sanitizer.txt") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/scripts/blacklist-address-sanitizer.txt") endif(fsanitize-blacklist) if(fsanitize-address-use-after-scope) @@ -360,7 +360,7 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCC) elseif(WITH_SANITIZE_MEMORY) list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-fsanitize=memory") CHECK_C_COMPILER_FLAG ("-fsanitize=memory" fsanitize-memory) - CHECK_C_COMPILER_FLAG ("-fsanitize-blacklist=${CMAKE_BINARY_DIR}/foo.txt" fsanitize-blacklist) + CHECK_C_COMPILER_FLAG ("-fsanitize-blacklist=${PROJECT_BINARY_DIR}/foo.txt" fsanitize-blacklist) CHECK_C_COMPILER_FLAG ("-fsanitize-memory-use-after-dtor" fsanitize-memory-use-after-dtor) CHECK_C_COMPILER_FLAG ("-fsanitize-memory-track-origins" fsanitize-memory-track-origins) @@ -369,7 +369,7 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory") if(fsanitize-blacklist) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/scripts/blacklist-memory-sanitizer.txt") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/scripts/blacklist-memory-sanitizer.txt") endif(fsanitize-blacklist) if (fsanitize-memory-use-after-dtor) @@ -382,17 +382,17 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCC) elseif(WITH_SANITIZE_THREAD) list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-fsanitize=thread") CHECK_C_COMPILER_FLAG ("-fsanitize=thread" fsanitize-thread) - CHECK_C_COMPILER_FLAG ("-fsanitize-blacklist=${CMAKE_BINARY_DIR}/foo.txt" fsanitize-blacklist) + CHECK_C_COMPILER_FLAG ("-fsanitize-blacklist=${PROJECT_BINARY_DIR}/foo.txt" fsanitize-blacklist) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread") if(fsanitize-blacklist) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/scripts/blacklist-thread-sanitizer.txt") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/scripts/blacklist-thread-sanitizer.txt") endif(fsanitize-blacklist) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread") endif() - file(REMOVE ${CMAKE_BINARY_DIR}/foo.txt) + file(REMOVE ${PROJECT_BINARY_DIR}/foo.txt) set(CMAKE_REQUIRED_LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS_SAVED}) if (WITH_NO_UNDEFINED) @@ -444,9 +444,9 @@ if(WIN32) set(CMAKE_USE_RELATIVE_PATH ON) if (${CMAKE_GENERATOR} MATCHES "NMake Makefile*" OR ${CMAKE_GENERATOR} MATCHES "Ninja*" OR ${CMAKE_GENERATOR} MATCHES "Unix Makefiles") - set(CMAKE_PDB_BINARY_DIR ${CMAKE_BINARY_DIR}) + set(CMAKE_PDB_BINARY_DIR ${PROJECT_BINARY_DIR}) elseif (${CMAKE_GENERATOR} MATCHES "Visual Studio*") - set(CMAKE_PDB_BINARY_DIR "${CMAKE_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") + set(CMAKE_PDB_BINARY_DIR "${PROJECT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") else() message(FATAL_ERROR "Unknown generator ${CMAKE_GENERATOR}") endif() @@ -585,8 +585,8 @@ if(ANDROID) set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH ) if (WITH_GPROF) - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/scripts/gprof_generate.sh.cmake - ${CMAKE_BINARY_DIR}/scripts/gprof_generate.sh @ONLY) + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/scripts/gprof_generate.sh.cmake + ${PROJECT_BINARY_DIR}/scripts/gprof_generate.sh @ONLY) endif(WITH_GPROF) endif() @@ -924,7 +924,7 @@ set(FREERDP_EXTENSION_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/freerdp${FREERDP_VERSIO # Proxy plugins path if(NOT DEFINED PROXY_PLUGINDIR) message("using default plugins location") - set(FREERDP_PROXY_PLUGINDIR "${CMAKE_BINARY_DIR}/server/proxy/plugins") + set(FREERDP_PROXY_PLUGINDIR "${PROJECT_BINARY_DIR}/server/proxy/plugins") else() set(FREERDP_PROXY_PLUGINDIR "${PROXY_PLUGINDIR}") endif() @@ -972,9 +972,9 @@ if(BUILD_TESTING) enable_testing() if(MSVC) - set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") + set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") else() - set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Testing") + set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Testing") endif() endif() @@ -988,8 +988,8 @@ if (FREERDP_UNIFIED_BUILD) add_subdirectory(rdtk) endif() - include_directories(${CMAKE_SOURCE_DIR}/winpr/include) - include_directories(${CMAKE_BINARY_DIR}/winpr/include) + include_directories(${PROJECT_SOURCE_DIR}/winpr/include) + include_directories(${PROJECT_BINARY_DIR}/winpr/include) else() find_package(WinPR 3 REQUIRED) include_directories(${WinPR_INCLUDE_DIR}) @@ -1041,7 +1041,7 @@ set(CMAKE_CPACK_INCLUDE_FILE "CMakeCPack.cmake") if(NOT (VENDOR MATCHES "FreeRDP")) if(DEFINED CLIENT_VENDOR_PATH) - if(EXISTS "${CMAKE_SOURCE_DIR}/${CLIENT_VENDOR_PATH}/CMakeCPack.cmake") + if(EXISTS "${PROJECT_SOURCE_DIR}/${CLIENT_VENDOR_PATH}/CMakeCPack.cmake") set(CMAKE_CPACK_INCLUDE_FILE "${CLIENT_VENDOR_PATH}/CMakeCPack.cmake") endif() endif() diff --git a/channels/CMakeLists.txt b/channels/CMakeLists.txt index 17715a3dc..a7c8f9636 100644 --- a/channels/CMakeLists.txt +++ b/channels/CMakeLists.txt @@ -191,7 +191,7 @@ macro(add_channel_client_library _module_prefix _module_name _channel_name _dyna set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${_module_name}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) @@ -232,7 +232,7 @@ macro(add_channel_client_subsystem_library _module_prefix _module_name _channel_ set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${_module_name}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) @@ -271,7 +271,7 @@ macro(add_channel_server_library _module_prefix _module_name _channel_name _dyna set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${_module_name}${FREERDP_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/channels/audin/client/CMakeLists.txt b/channels/audin/client/CMakeLists.txt index f03d99f1b..a9fb40ba5 100644 --- a/channels/audin/client/CMakeLists.txt +++ b/channels/audin/client/CMakeLists.txt @@ -28,7 +28,7 @@ add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} TRUE target_link_libraries(${MODULE_NAME} freerdp winpr) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/audin/client/winmm/CMakeLists.txt b/channels/audin/client/winmm/CMakeLists.txt index 2eddb8e16..408a3a2e1 100644 --- a/channels/audin/client/winmm/CMakeLists.txt +++ b/channels/audin/client/winmm/CMakeLists.txt @@ -32,7 +32,7 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client/winmm") diff --git a/channels/disp/client/CMakeLists.txt b/channels/disp/client/CMakeLists.txt index 6376f6e47..c8c1f8560 100644 --- a/channels/disp/client/CMakeLists.txt +++ b/channels/disp/client/CMakeLists.txt @@ -35,7 +35,7 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/drive/client/CMakeLists.txt b/channels/drive/client/CMakeLists.txt index 2c2be3930..33de5e68b 100644 --- a/channels/drive/client/CMakeLists.txt +++ b/channels/drive/client/CMakeLists.txt @@ -30,7 +30,7 @@ target_link_libraries(${MODULE_NAME} winpr freerdp) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/echo/client/CMakeLists.txt b/channels/echo/client/CMakeLists.txt index 149fbbf5a..ade3d71d6 100644 --- a/channels/echo/client/CMakeLists.txt +++ b/channels/echo/client/CMakeLists.txt @@ -26,7 +26,7 @@ include_directories(..) add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} TRUE "DVCPluginEntry") if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() target_link_libraries(${MODULE_NAME} winpr) diff --git a/channels/geometry/client/CMakeLists.txt b/channels/geometry/client/CMakeLists.txt index ac9fdc407..662f8eb12 100644 --- a/channels/geometry/client/CMakeLists.txt +++ b/channels/geometry/client/CMakeLists.txt @@ -34,7 +34,7 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/parallel/client/CMakeLists.txt b/channels/parallel/client/CMakeLists.txt index 255435bdb..05c1147e1 100644 --- a/channels/parallel/client/CMakeLists.txt +++ b/channels/parallel/client/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_libraries(${MODULE_NAME} freerdp winpr) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/printer/client/CMakeLists.txt b/channels/printer/client/CMakeLists.txt index 58d44f99e..f2c17c001 100644 --- a/channels/printer/client/CMakeLists.txt +++ b/channels/printer/client/CMakeLists.txt @@ -26,7 +26,7 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr freerdp) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/rdpei/client/CMakeLists.txt b/channels/rdpei/client/CMakeLists.txt index 79cc5a11c..cc689589d 100644 --- a/channels/rdpei/client/CMakeLists.txt +++ b/channels/rdpei/client/CMakeLists.txt @@ -32,7 +32,7 @@ target_link_libraries(${MODULE_NAME} winpr freerdp) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/rdpgfx/client/CMakeLists.txt b/channels/rdpgfx/client/CMakeLists.txt index 0de358a2e..de2383ab0 100644 --- a/channels/rdpgfx/client/CMakeLists.txt +++ b/channels/rdpgfx/client/CMakeLists.txt @@ -34,7 +34,7 @@ add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} TRUE target_link_libraries(${MODULE_NAME} winpr freerdp) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/serial/client/CMakeLists.txt b/channels/serial/client/CMakeLists.txt index f16995b00..fb08df0f0 100644 --- a/channels/serial/client/CMakeLists.txt +++ b/channels/serial/client/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_libraries(${MODULE_NAME} winpr freerdp) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/sshagent/client/CMakeLists.txt b/channels/sshagent/client/CMakeLists.txt index 7feea9668..b7d47e603 100644 --- a/channels/sshagent/client/CMakeLists.txt +++ b/channels/sshagent/client/CMakeLists.txt @@ -27,7 +27,7 @@ include_directories(..) add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} TRUE "DVCPluginEntry") if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() target_link_libraries(${MODULE_NAME} winpr) diff --git a/channels/tsmf/client/CMakeLists.txt b/channels/tsmf/client/CMakeLists.txt index d7438de91..8d66db9ee 100644 --- a/channels/tsmf/client/CMakeLists.txt +++ b/channels/tsmf/client/CMakeLists.txt @@ -80,7 +80,7 @@ add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} TRUE target_link_libraries(${MODULE_NAME} freerdp winpr) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/tsmf/client/ffmpeg/CMakeLists.txt b/channels/tsmf/client/ffmpeg/CMakeLists.txt index cda0bdfd7..e6adc14c9 100644 --- a/channels/tsmf/client/ffmpeg/CMakeLists.txt +++ b/channels/tsmf/client/ffmpeg/CMakeLists.txt @@ -40,6 +40,6 @@ else() endif() if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() diff --git a/channels/urbdrc/client/CMakeLists.txt b/channels/urbdrc/client/CMakeLists.txt index 2d6961842..c014c9624 100644 --- a/channels/urbdrc/client/CMakeLists.txt +++ b/channels/urbdrc/client/CMakeLists.txt @@ -38,7 +38,7 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr freerdp) target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWOARD} ${${MODULE_PREFIX}_LIBS}) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/channels/urbdrc/client/libusb/CMakeLists.txt b/channels/urbdrc/client/libusb/CMakeLists.txt index c5e9b7087..a6304f8b3 100644 --- a/channels/urbdrc/client/libusb/CMakeLists.txt +++ b/channels/urbdrc/client/libusb/CMakeLists.txt @@ -41,6 +41,6 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr urbdrc-client) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() diff --git a/channels/video/client/CMakeLists.txt b/channels/video/client/CMakeLists.txt index cbbe483db..7aa59ab34 100644 --- a/channels/video/client/CMakeLists.txt +++ b/channels/video/client/CMakeLists.txt @@ -33,7 +33,7 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) if (WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${FREERDP_ADDIN_PATH} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client") diff --git a/client/Sample/CMakeLists.txt b/client/Sample/CMakeLists.txt index a8e9a6e9e..a66202e91 100644 --- a/client/Sample/CMakeLists.txt +++ b/client/Sample/CMakeLists.txt @@ -33,7 +33,7 @@ if (WIN32) set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/client/Wayland/CMakeLists.txt b/client/Wayland/CMakeLists.txt index f881fe9a8..9c29b0083 100644 --- a/client/Wayland/CMakeLists.txt +++ b/client/Wayland/CMakeLists.txt @@ -37,8 +37,8 @@ set(${MODULE_PREFIX}_SRCS ) if (FREERDP_UNIFIED_BUILD) - include_directories(${CMAKE_SOURCE_DIR}/uwac/include) - include_directories(${CMAKE_BINARY_DIR}/uwac/include) + include_directories(${PROJECT_SOURCE_DIR}/uwac/include) + include_directories(${PROJECT_BINARY_DIR}/uwac/include) else() find_package(uwac 0 REQUIRED) include_directories(${UWAC_INCLUDE_DIR}) diff --git a/client/Windows/CMakeLists.txt b/client/Windows/CMakeLists.txt index 9cef17f60..eea5d8bbe 100644 --- a/client/Windows/CMakeLists.txt +++ b/client/Windows/CMakeLists.txt @@ -51,7 +51,7 @@ if (WIN32 AND BUILD_SHARED_LIBS) endif() configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/client/Windows/cli/CMakeLists.txt b/client/Windows/cli/CMakeLists.txt index 02726118f..6bac310d0 100644 --- a/client/Windows/cli/CMakeLists.txt +++ b/client/Windows/cli/CMakeLists.txt @@ -34,7 +34,7 @@ if (WIN32) set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/client/X11/CMakeLists.txt b/client/X11/CMakeLists.txt index 774272d31..97d783ed1 100644 --- a/client/X11/CMakeLists.txt +++ b/client/X11/CMakeLists.txt @@ -239,7 +239,7 @@ if(WITH_FUSE) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${FUSE_LIBRARIES}) endif() -include_directories(${CMAKE_SOURCE_DIR}/resources) +include_directories(${PROJECT_SOURCE_DIR}/resources) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client freerdp m) if (NOT APPLE) diff --git a/client/common/CMakeLists.txt b/client/common/CMakeLists.txt index 65f82d7fa..77364e330 100644 --- a/client/common/CMakeLists.txt +++ b/client/common/CMakeLists.txt @@ -49,7 +49,7 @@ if (WIN32 AND BUILD_SHARED_LIBS) set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/cmake/CheckCmakeCompat.cmake b/cmake/CheckCmakeCompat.cmake index a6e3804b2..460e59dca 100644 --- a/cmake/CheckCmakeCompat.cmake +++ b/cmake/CheckCmakeCompat.cmake @@ -18,7 +18,7 @@ macro(enable_cmake_compat CMVERSION) if(${CMAKE_VERSION} VERSION_LESS ${CMVERSION}) - LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/compat_${CMVERSION}/") + LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/compat_${CMVERSION}/") endif() endmacro() diff --git a/cmake/GetGitRevisionDescription.cmake b/cmake/GetGitRevisionDescription.cmake index 432149d30..237f9df36 100644 --- a/cmake/GetGitRevisionDescription.cmake +++ b/cmake/GetGitRevisionDescription.cmake @@ -41,7 +41,7 @@ get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) function(get_git_head_revision _refspecvar _hashvar) - set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}") + set(GIT_PARENT_DIR "${PROJECT_SOURCE_DIR}") set(GIT_DIR "${GIT_PARENT_DIR}/.git") while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") @@ -89,7 +89,7 @@ function(git_rev_parse _var) endif() execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse ${ARGN} ${hash} - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_QUIET @@ -117,7 +117,7 @@ function(git_describe _var) endif() execute_process(COMMAND "${GIT_EXECUTABLE}" describe ${hash} ${ARGN} - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_QUIET diff --git a/libfreerdp/CMakeLists.txt b/libfreerdp/CMakeLists.txt index f7e8da9e5..f135a9e94 100644 --- a/libfreerdp/CMakeLists.txt +++ b/libfreerdp/CMakeLists.txt @@ -369,7 +369,7 @@ if (WIN32) set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/libfreerdp/core/test/CMakeLists.txt b/libfreerdp/core/test/CMakeLists.txt index 01ea85d11..9e8be8b14 100644 --- a/libfreerdp/core/test/CMakeLists.txt +++ b/libfreerdp/core/test/CMakeLists.txt @@ -22,8 +22,8 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) -add_definitions(-DTESTING_OUTPUT_DIRECTORY="${CMAKE_BINARY_DIR}") -add_definitions(-DTESTING_SRC_DIRECTORY="${CMAKE_SOURCE_DIR}") +add_definitions(-DTESTING_OUTPUT_DIRECTORY="${PROJECT_BINARY_DIR}") +add_definitions(-DTESTING_SRC_DIRECTORY="${PROJECT_SOURCE_DIR}") target_link_libraries(${MODULE_NAME} freerdp winpr freerdp-client) diff --git a/rdtk/CMakeLists.txt b/rdtk/CMakeLists.txt index e78a1f826..f422abb3a 100644 --- a/rdtk/CMakeLists.txt +++ b/rdtk/CMakeLists.txt @@ -82,8 +82,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) if (FREERDP_UNIFIED_BUILD) - include_directories(${CMAKE_SOURCE_DIR}/winpr/include) - include_directories(${CMAKE_BINARY_DIR}/winpr/include) + include_directories(${PROJECT_SOURCE_DIR}/winpr/include) + include_directories(${PROJECT_BINARY_DIR}/winpr/include) else() find_package(WinPR 3 REQUIRED) include_directories(${WinPR_INCLUDE_DIR}) diff --git a/rdtk/librdtk/CMakeLists.txt b/rdtk/librdtk/CMakeLists.txt index e56434660..0fc17dd3c 100644 --- a/rdtk/librdtk/CMakeLists.txt +++ b/rdtk/librdtk/CMakeLists.txt @@ -45,7 +45,7 @@ if (WIN32) set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${RDTK_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/scripts/gprof_generate.sh.cmake b/scripts/gprof_generate.sh.cmake index bf2cc5ed3..848989f2c 100755 --- a/scripts/gprof_generate.sh.cmake +++ b/scripts/gprof_generate.sh.cmake @@ -18,7 +18,7 @@ fi GCC=@CMAKE_C_COMPILER@ GPROF=${GCC/gcc/gprof} -LIB=@CMAKE_BINARY_DIR@/client/Android/FreeRDPCore/jni/armeabi-v7a/libfreerdp-android.so +LIB=@PROJECT_BINARY_DIR@/client/Android/FreeRDPCore/jni/armeabi-v7a/libfreerdp-android.so if [ ! -f $LIB ]; then echo "Missing libfreerdp-android.so" diff --git a/server/Sample/CMakeLists.txt b/server/Sample/CMakeLists.txt index 451f3e960..9e31827e3 100644 --- a/server/Sample/CMakeLists.txt +++ b/server/Sample/CMakeLists.txt @@ -37,7 +37,7 @@ if (WIN32) set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/server/Windows/CMakeLists.txt b/server/Windows/CMakeLists.txt index cb8092558..a9460b121 100644 --- a/server/Windows/CMakeLists.txt +++ b/server/Windows/CMakeLists.txt @@ -70,7 +70,7 @@ else() endif() configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) @@ -104,13 +104,13 @@ if(WITH_SERVER_INTERFACE) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols) endif() else() install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) if (WITH_DEBUG_SYMBOLS AND MSVC) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols) endif() endif() diff --git a/server/Windows/cli/CMakeLists.txt b/server/Windows/cli/CMakeLists.txt index e60de909d..7e36b46d1 100644 --- a/server/Windows/cli/CMakeLists.txt +++ b/server/Windows/cli/CMakeLists.txt @@ -32,7 +32,7 @@ set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION}) set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) @@ -49,7 +49,7 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) if (WITH_DEBUG_SYMBOLS AND MSVC) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Windows") diff --git a/server/common/CMakeLists.txt b/server/common/CMakeLists.txt index aa11dd06a..3254b14e2 100644 --- a/server/common/CMakeLists.txt +++ b/server/common/CMakeLists.txt @@ -46,7 +46,7 @@ if (WIN32) set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/server/proxy/CMakeLists.txt b/server/proxy/CMakeLists.txt index a512dd9c6..741a7fffd 100644 --- a/server/proxy/CMakeLists.txt +++ b/server/proxy/CMakeLists.txt @@ -65,7 +65,7 @@ if (WIN32) set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/server/proxy/modules/CMakeLists.txt b/server/proxy/modules/CMakeLists.txt index ed8ec43df..500a3e7ec 100644 --- a/server/proxy/modules/CMakeLists.txt +++ b/server/proxy/modules/CMakeLists.txt @@ -18,8 +18,8 @@ # automatically included by CMake when the -DWITH_THIRD_PARTY=on option is used. # include proxy header files for proxy modules -include_directories("${CMAKE_SOURCE_DIR}/server/proxy") -include_directories("${CMAKE_SOURCE_DIR}/server/proxy/modules") +include_directories("${PROJECT_SOURCE_DIR}/server/proxy") +include_directories("${PROJECT_SOURCE_DIR}/server/proxy/modules") # taken from FreeRDP/third-party/CMakeLists.txt file(GLOB all_valid_subdirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/CMakeLists.txt") diff --git a/server/shadow/CMakeLists.txt b/server/shadow/CMakeLists.txt index 9ef73472c..c95bdb0f5 100644 --- a/server/shadow/CMakeLists.txt +++ b/server/shadow/CMakeLists.txt @@ -58,8 +58,8 @@ if (NOT FREERDP_UNIFIED_BUILD) find_package(rdtk 0 REQUIRED) include_directories(${RDTK_INCLUDE_DIR}) else() - include_directories(${CMAKE_SOURCE_DIR}/rdtk/include) - include_directories(${CMAKE_BINARY_DIR}/rdtk/include) + include_directories(${PROJECT_SOURCE_DIR}/rdtk/include) + include_directories(${PROJECT_BINARY_DIR}/rdtk/include) endif() # On windows create dll version information. @@ -72,7 +72,7 @@ if (WIN32) set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) @@ -101,7 +101,7 @@ install(TARGETS ${MODULE_NAME} COMPONENT server EXPORT FreeRDP-ShadowTargets if (WITH_DEBUG_SYMBOLS AND MSVC) get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME) - install(FILES ${CMAKE_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/shadow") @@ -129,7 +129,7 @@ if (WIN32) set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) @@ -309,7 +309,7 @@ install(TARGETS ${MODULE_NAME} COMPONENT server EXPORT FreeRDP-ShadowTargets if (WITH_DEBUG_SYMBOLS AND MSVC) get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME) - install(FILES ${CMAKE_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} + install(FILES ${PROJECT_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols) endif() @@ -332,7 +332,7 @@ if (WIN32) set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) @@ -347,7 +347,7 @@ target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) if (WITH_DEBUG_SYMBOLS AND MSVC) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols) endif() diff --git a/uwac/CMakeLists.txt b/uwac/CMakeLists.txt index f8543f54d..00e26ec95 100644 --- a/uwac/CMakeLists.txt +++ b/uwac/CMakeLists.txt @@ -73,10 +73,10 @@ if (HAVE_PIXMAN_REGION) include_directories(${pixman_INCLUDE_DIRS}) add_definitions(-DHAVE_PIXMAN_REGION) elseif (FREERDP_UNIFIED_BUILD) - include_directories(${CMAKE_SOURCE_DIR}/winpr/include) - include_directories(${CMAKE_BINARY_DIR}/winpr/include) - include_directories(${CMAKE_SOURCE_DIR}/include) - include_directories(${CMAKE_BINARY_DIR}/include) + include_directories(${PROJECT_SOURCE_DIR}/winpr/include) + include_directories(${PROJECT_BINARY_DIR}/winpr/include) + include_directories(${PROJECT_SOURCE_DIR}/include) + include_directories(${PROJECT_BINARY_DIR}/include) else() find_package(WinPR 3 REQUIRED) find_package(FreeRDP 3 REQUIRED) diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt index e5dfd61ca..82064775c 100644 --- a/winpr/CMakeLists.txt +++ b/winpr/CMakeLists.txt @@ -69,8 +69,8 @@ endif() # Soname versioning set(RAW_VERSION_STRING "3.0.0-dev") -if(EXISTS "${CMAKE_SOURCE_DIR}/.source_tag") - file(READ ${CMAKE_SOURCE_DIR}/.source_tag RAW_VERSION_STRING) +if(EXISTS "${PROJECT_SOURCE_DIR}/.source_tag") + file(READ ${PROJECT_SOURCE_DIR}/.source_tag RAW_VERSION_STRING) elseif(USE_VERSION_FROM_GIT_TAG) git_get_exact_tag(_GIT_TAG --tags --always) if (NOT ${_GIT_TAG} STREQUAL "n/a") @@ -187,9 +187,9 @@ set(OPENSSL_FEATURE_TYPE "RECOMMENDED") enable_testing() if(MSVC) - set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") + set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") else() - set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Testing") + set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Testing") endif() # Default to release build type diff --git a/winpr/libwinpr/CMakeLists.txt b/winpr/libwinpr/CMakeLists.txt index af2d4782a..ca4cd6530 100644 --- a/winpr/libwinpr/CMakeLists.txt +++ b/winpr/libwinpr/CMakeLists.txt @@ -128,7 +128,7 @@ if (WIN32) set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${WINPR_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/winpr/tools/CMakeLists.txt b/winpr/tools/CMakeLists.txt index 40031c4f3..db9c30355 100644 --- a/winpr/tools/CMakeLists.txt +++ b/winpr/tools/CMakeLists.txt @@ -95,7 +95,7 @@ if (WIN32) set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${WINPR_TOOLS_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/winpr/tools/hash-cli/CMakeLists.txt b/winpr/tools/hash-cli/CMakeLists.txt index 9f8c7a8a0..18a638ab1 100644 --- a/winpr/tools/hash-cli/CMakeLists.txt +++ b/winpr/tools/hash-cli/CMakeLists.txt @@ -30,7 +30,7 @@ if (WIN32) set(RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}") configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) @@ -46,7 +46,7 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools EXPORT WinPRTargets) if (WITH_DEBUG_SYMBOLS AND MSVC) - install(FILES ${CMAKE_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols) + install(FILES ${PROJECT_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols) endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools") diff --git a/winpr/tools/makecert-cli/CMakeLists.txt b/winpr/tools/makecert-cli/CMakeLists.txt index 48fda5b5e..b5e835c8f 100644 --- a/winpr/tools/makecert-cli/CMakeLists.txt +++ b/winpr/tools/makecert-cli/CMakeLists.txt @@ -31,7 +31,7 @@ if (WIN32) set(RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}") configure_file( - ${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in + ${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)