summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2010-12-21 14:17:21 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2010-12-21 14:20:57 (GMT)
commit16e7d4ba2c82081afea5af05bc6360b281d5e0c3 (patch)
tree95241b18ac6b3bc0e7db8bc1f846ab4b8e7f1148 /Tests
parent4c88a8622dd25bc3d630f2d35e3a4acca9a7a5a2 (diff)
downloadCMake-16e7d4ba2c82081afea5af05bc6360b281d5e0c3.zip
CMake-16e7d4ba2c82081afea5af05bc6360b281d5e0c3.tar.gz
CMake-16e7d4ba2c82081afea5af05bc6360b281d5e0c3.tar.bz2
Add flags to resource builds on vs 2010 with a test.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt12
-rw-r--r--Tests/VSResource/CMakeLists.txt4
-rw-r--r--Tests/VSResource/main.cpp10
-rw-r--r--Tests/VSResource/test.rc5
-rw-r--r--Tests/VSResource/test.txt1
5 files changed, 31 insertions, 1 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 04f0774..f7d3c18 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -246,7 +246,6 @@ IF(BUILD_TESTING)
--test-command Simple)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
ENDIF ("${cmakeOutput}" MATCHES CodeBlocks)
-
# check for the KDevelop3 generator
IF ("${cmakeOutput}" MATCHES KDevelop3)
ADD_TEST(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND}
@@ -262,6 +261,17 @@ IF(BUILD_TESTING)
ENDIF ("${cmakeOutput}" MATCHES KDevelop3)
ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
+ ADD_TEST(VSResource ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VSResource"
+ "${CMake_BINARY_DIR}/Tests/VSResource"
+ --build-two-config
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project VSResource
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --test-command VSResource)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSResource")
+
# test for correct sub-project generation
# not implemented in VS6 or Xcode
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt
new file mode 100644
index 0000000..8a71bd0
--- /dev/null
+++ b/Tests/VSResource/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required (VERSION 2.6)
+project (VSResource)
+add_definitions(/DCMAKE_RCDEFINE="test.txt")
+add_executable(VSResource main.cpp test.rc)
diff --git a/Tests/VSResource/main.cpp b/Tests/VSResource/main.cpp
new file mode 100644
index 0000000..6f68df3
--- /dev/null
+++ b/Tests/VSResource/main.cpp
@@ -0,0 +1,10 @@
+#include <windows.h>
+
+int main(int argc, char** argv) {
+ HRSRC hello = ::FindResource(0, "hello", "TEXT");
+ if(hello) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
diff --git a/Tests/VSResource/test.rc b/Tests/VSResource/test.rc
new file mode 100644
index 0000000..8aab8b7
--- /dev/null
+++ b/Tests/VSResource/test.rc
@@ -0,0 +1,5 @@
+#ifdef CMAKE_RCDEFINE
+hello TEXT DISCARDABLE CMAKE_RCDEFINE
+#else
+#error "resource compiler did not get defines from command line!"
+#endif \ No newline at end of file
diff --git a/Tests/VSResource/test.txt b/Tests/VSResource/test.txt
new file mode 100644
index 0000000..980a0d5
--- /dev/null
+++ b/Tests/VSResource/test.txt
@@ -0,0 +1 @@
+Hello World!