summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-05-19 12:11:34 (GMT)
committerBrad King <brad.king@kitware.com>2011-05-19 11:38:06 (GMT)
commit7039d1fd9b817a3ab6c81b4ef313a0bd6e19778d (patch)
tree99fd1835f9717980e5a4953ea0c9a52160e52e65
parent4268e3d7e92eee0871dac1b92f64e18c374c7b43 (diff)
downloadCMake-7039d1fd9b817a3ab6c81b4ef313a0bd6e19778d.zip
CMake-7039d1fd9b817a3ab6c81b4ef313a0bd6e19778d.tar.gz
CMake-7039d1fd9b817a3ab6c81b4ef313a0bd6e19778d.tar.bz2
Fix CompileCommandOutput test for Make tools not supporting spaces
Use underscores instead of spaces for such Make tools.
-rw-r--r--Tests/CMakeLists.txt3
-rw-r--r--Tests/CompileCommandOutput/CMakeLists.txt7
-rw-r--r--Tests/CompileCommandOutput/compile_command_output.cxx4
-rw-r--r--Tests/CompileCommandOutput/file with spaces.cxx4
-rw-r--r--Tests/CompileCommandOutput/file with spaces.h1
-rw-r--r--Tests/CompileCommandOutput/file_with_underscores.cxx3
-rw-r--r--Tests/CompileCommandOutput/file_with_underscores.h1
7 files changed, 16 insertions, 7 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 2344af7..e9aed16 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -11,6 +11,7 @@ MACRO(ADD_TEST_MACRO NAME COMMAND)
--build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project ${proj}
+ ${${NAME}_EXTRA_OPTIONS}
--test-command ${COMMAND} ${ARGN})
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
ENDMACRO(ADD_TEST_MACRO)
@@ -2037,6 +2038,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ENDFOREACH()
IF(TEST_CompileCommandOutput)
+ SET(CompileCommandOutput_EXTRA_OPTIONS
+ --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_IS_GNU})
ADD_TEST_MACRO(CompileCommandOutput
"${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands")
ENDIF()
diff --git a/Tests/CompileCommandOutput/CMakeLists.txt b/Tests/CompileCommandOutput/CMakeLists.txt
index ac39b8b..bd8e305 100644
--- a/Tests/CompileCommandOutput/CMakeLists.txt
+++ b/Tests/CompileCommandOutput/CMakeLists.txt
@@ -4,7 +4,12 @@ project (CompileCommandOutput CXX)
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
-ADD_LIBRARY(test1 STATIC "file with spaces.cxx")
+IF(MAKE_SUPPORTS_SPACES)
+ SET(test1_srcs "file with spaces.cxx")
+ELSE()
+ SET(test1_srcs "file_with_underscores.cxx")
+ENDIF()
+ADD_LIBRARY(test1 STATIC ${test1_srcs})
ADD_LIBRARY(test2 SHARED "../CompileCommandOutput/relative.cxx")
INCLUDE_DIRECTORIES(${CompileCommandOutput_SOURCE_DIR}/../../Source)
ADD_EXECUTABLE(CompileCommandOutput compile_command_output.cxx)
diff --git a/Tests/CompileCommandOutput/compile_command_output.cxx b/Tests/CompileCommandOutput/compile_command_output.cxx
index 9487c89..145a064 100644
--- a/Tests/CompileCommandOutput/compile_command_output.cxx
+++ b/Tests/CompileCommandOutput/compile_command_output.cxx
@@ -1,9 +1,9 @@
-#include "file with spaces.h"
+#include "file_with_underscores.h"
#include "relative.h"
int main (int argc, char** argv)
{
- file_with_spaces();
+ file_with_underscores();
relative();
return 0;
}
diff --git a/Tests/CompileCommandOutput/file with spaces.cxx b/Tests/CompileCommandOutput/file with spaces.cxx
index 5759319..554e176 100644
--- a/Tests/CompileCommandOutput/file with spaces.cxx
+++ b/Tests/CompileCommandOutput/file with spaces.cxx
@@ -1,3 +1 @@
-#include "file with spaces.h"
-
-void file_with_spaces() {}
+#include "file_with_underscores.cxx"
diff --git a/Tests/CompileCommandOutput/file with spaces.h b/Tests/CompileCommandOutput/file with spaces.h
deleted file mode 100644
index 49b686c..0000000
--- a/Tests/CompileCommandOutput/file with spaces.h
+++ /dev/null
@@ -1 +0,0 @@
-void file_with_spaces();
diff --git a/Tests/CompileCommandOutput/file_with_underscores.cxx b/Tests/CompileCommandOutput/file_with_underscores.cxx
new file mode 100644
index 0000000..4f42ccf
--- /dev/null
+++ b/Tests/CompileCommandOutput/file_with_underscores.cxx
@@ -0,0 +1,3 @@
+#include "file_with_underscores.h"
+
+void file_with_underscores() {}
diff --git a/Tests/CompileCommandOutput/file_with_underscores.h b/Tests/CompileCommandOutput/file_with_underscores.h
new file mode 100644
index 0000000..0d73e31
--- /dev/null
+++ b/Tests/CompileCommandOutput/file_with_underscores.h
@@ -0,0 +1 @@
+void file_with_underscores();