Add flags to resource builds on vs 2010 with a test.
This commit is contained in:
parent
4c88a8622d
commit
16e7d4ba2c
|
@ -1139,10 +1139,13 @@ OutputIncludes(std::vector<std::string> const & includes)
|
||||||
|
|
||||||
|
|
||||||
void cmVisualStudio10TargetGenerator::
|
void cmVisualStudio10TargetGenerator::
|
||||||
WriteRCOptions(std::string const& ,
|
WriteRCOptions(std::string const& configName,
|
||||||
std::vector<std::string> const & includes)
|
std::vector<std::string> const & includes)
|
||||||
{
|
{
|
||||||
this->WriteString("<ResourceCompile>\n", 2);
|
this->WriteString("<ResourceCompile>\n", 2);
|
||||||
|
Options& clOptions = *(this->ClOptions[configName]);
|
||||||
|
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
|
||||||
|
"\n");
|
||||||
this->OutputIncludes(includes);
|
this->OutputIncludes(includes);
|
||||||
this->WriteString("</ResourceCompile>\n", 2);
|
this->WriteString("</ResourceCompile>\n", 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,6 @@ IF(BUILD_TESTING)
|
||||||
--test-command Simple)
|
--test-command Simple)
|
||||||
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
|
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
|
||||||
ENDIF ("${cmakeOutput}" MATCHES CodeBlocks)
|
ENDIF ("${cmakeOutput}" MATCHES CodeBlocks)
|
||||||
|
|
||||||
# check for the KDevelop3 generator
|
# check for the KDevelop3 generator
|
||||||
IF ("${cmakeOutput}" MATCHES KDevelop3)
|
IF ("${cmakeOutput}" MATCHES KDevelop3)
|
||||||
ADD_TEST(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND}
|
ADD_TEST(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND}
|
||||||
|
@ -262,6 +261,17 @@ IF(BUILD_TESTING)
|
||||||
ENDIF ("${cmakeOutput}" MATCHES KDevelop3)
|
ENDIF ("${cmakeOutput}" MATCHES KDevelop3)
|
||||||
|
|
||||||
ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
|
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
|
# test for correct sub-project generation
|
||||||
# not implemented in VS6 or Xcode
|
# not implemented in VS6 or Xcode
|
||||||
|
|
|
@ -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)
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#ifdef CMAKE_RCDEFINE
|
||||||
|
hello TEXT DISCARDABLE CMAKE_RCDEFINE
|
||||||
|
#else
|
||||||
|
#error "resource compiler did not get defines from command line!"
|
||||||
|
#endif
|
|
@ -0,0 +1 @@
|
||||||
|
Hello World!
|
Loading…
Reference in New Issue