diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/CMakeLists.txt | 19 | ||||
-rw-r--r-- | cli/cli_resources.cpp | 4 |
2 files changed, 6 insertions, 17 deletions
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 727cd7f8..9198a8f5 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -36,22 +36,11 @@ target_link_libraries (apitrace ) if (NOT CMAKE_CROSSCOMPILING) - set_target_properties (apitrace PROPERTIES - # On debug builds tell where the source is so that scripts can be found - COMPILE_DEFINITIONS_DEBUG APITRACE_SOURCE_DIR="${CMAKE_SOURCE_DIR}" + # On debug builds tell where the source is so that scripts can be found + # http://www.cmake.org/cmake/help/v3.0/policy/CMP0043.html + target_compile_definitions (apitrace PRIVATE + $<$<CONFIG:Debug>:APITRACE_SOURCE_DIR="${CMAKE_SOURCE_DIR}"> ) endif () -if (MSVC AND NOT CMAKE_GENERATOR STREQUAL "Ninja") - # On MSVC builds tell which subdirectory the binaries with be (for each - # configuration) - set_target_properties (apitrace PROPERTIES - COMPILE_DEFINITIONS_DEBUG APITRACE_CONFIGURATION_SUBDIR="Debug" - COMPILE_DEFINITIONS_RELEASE APITRACE_CONFIGURATION_SUBDIR="Release" - COMPILE_DEFINITIONS_MINSIZEREL APITRACE_CONFIGURATION_SUBDIR="MinSizeRel" - COMPILE_DEFINITIONS_RELWITHDEBINFO APITRACE_CONFIGURATION_SUBDIR="RelWithDebInfo" - ) -endif () - - install (TARGETS apitrace RUNTIME DESTINATION bin) diff --git a/cli/cli_resources.cpp b/cli/cli_resources.cpp index d6d0a55d..e946c205 100644 --- a/cli/cli_resources.cpp +++ b/cli/cli_resources.cpp @@ -101,11 +101,11 @@ findWrapper(const char *wrapperFilename, bool verbose) // Try relative build directory // XXX: Just make build and install directory layout match wrapperPath = processDir; -#if defined(APITRACE_CONFIGURATION_SUBDIR) +#if defined(CMAKE_INTDIR) // Go from `Debug\apitrace.exe` to `wrappers\Debug\foo.dll` on MSVC builds. wrapperPath.join(".."); wrapperPath.join("wrappers"); - wrapperPath.join(APITRACE_CONFIGURATION_SUBDIR); + wrapperPath.join(CMAKE_INTDIR); #else wrapperPath.join("wrappers"); #endif |