diff options
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | empty.c | 0 |
2 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ee4c13d5..aabbc4fc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,9 +105,13 @@ if(CMAKE_COMPILER_IS_GNUCXX) if(DEFAULT_LIBRARY_DIRS) remove_list_duplicates(DEFAULT_LIBRARY_DIRS) endif(DEFAULT_LIBRARY_DIRS) + # Create a temporary file to test for the default include directories + FILE(WRITE empty.cpp "") # Next, we look for the compiler's default include directories # Run the command to find the default include directories - execute_process(COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/empty.c ERROR_VARIABLE LINES OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp ERROR_VARIABLE LINES OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE) + # Remove the empty file, it is no longer needed + FILE(REMOVE empty.cpp) # Convert the new lines to semicolons string(REGEX REPLACE "\n" ";" LINES ${LINES}) # Temporary variable saying if we are in the search list or not diff --git a/empty.c b/empty.c deleted file mode 100644 index e69de29bb..000000000 --- a/empty.c +++ /dev/null |