cmake fails when project is used in other cmake projects. CMAKE_CURRENT_LIST_DIR should be a more portable path

main
Jordan Schidlowsky 7 years ago committed by David Chisnall
parent dde74a8219
commit f5f452bcb9

@ -205,7 +205,7 @@ function(test_cxx CXX_RUNTIME_NAME IS_STDLIB)
message(STATUS "Testing ${CXX_RUNTIME_LIB} as the C++ runtime library")
try_compile(USERUNTIME
"${CMAKE_BINARY_DIR}/CMake"
"${CMAKE_SOURCE_DIR}/CMake"
"${CMAKE_CURRENT_LIST_DIR}/CMake"
test_cxx_runtime
CMAKE_FLAGS "-DCXX_RUNTIME=${CXX_RUNTIME_LIB}")
if (USERUNTIME)
@ -276,7 +276,7 @@ if (ENABLE_OBJCXX)
message(STATUS "Testing C++ standard library")
try_compile(USERUNTIME
"${CMAKE_BINARY_DIR}/CMake"
"${CMAKE_SOURCE_DIR}/CMake"
"${CMAKE_CURRENT_LIST_DIR}/CMake"
test_cxx_runtime)
if (${USERUNTIME})
message(STATUS "libobjc will depend on C++ standard library")

Loading…
Cancel
Save