summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Win32GenEx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-08-19 20:41:24 (GMT)
committerBrad King <brad.king@kitware.com>2020-08-21 13:17:27 (GMT)
commit3ef0c40962312a97d5a083c79ec563045fe28de3 (patch)
tree1b6231bd299e24a59ab83e8af875d77a1e287ba3 /Tests/RunCMake/Win32GenEx
parent8de3a25ec34c4b2d3cd7e519d3c3607e81de34c4 (diff)
downloadCMake-3ef0c40962312a97d5a083c79ec563045fe28de3.zip
CMake-3ef0c40962312a97d5a083c79ec563045fe28de3.tar.gz
CMake-3ef0c40962312a97d5a083c79ec563045fe28de3.tar.bz2
WIN32_EXECUTABLE: Add support for generator expressions
Diffstat (limited to 'Tests/RunCMake/Win32GenEx')
-rw-r--r--Tests/RunCMake/Win32GenEx/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Win32GenEx/RunCMakeTest.cmake28
-rw-r--r--Tests/RunCMake/Win32GenEx/Win32GenEx-debug.cmake1
-rw-r--r--Tests/RunCMake/Win32GenEx/Win32GenEx-release.cmake1
-rw-r--r--Tests/RunCMake/Win32GenEx/Win32GenEx.cmake7
-rw-r--r--Tests/RunCMake/Win32GenEx/main.c14
6 files changed, 54 insertions, 0 deletions
diff --git a/Tests/RunCMake/Win32GenEx/CMakeLists.txt b/Tests/RunCMake/Win32GenEx/CMakeLists.txt
new file mode 100644
index 0000000..b646c4a
--- /dev/null
+++ b/Tests/RunCMake/Win32GenEx/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.18)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Win32GenEx/RunCMakeTest.cmake b/Tests/RunCMake/Win32GenEx/RunCMakeTest.cmake
new file mode 100644
index 0000000..d5529b0
--- /dev/null
+++ b/Tests/RunCMake/Win32GenEx/RunCMakeTest.cmake
@@ -0,0 +1,28 @@
+include(RunCMake)
+
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Win32GenEx-build)
+ run_cmake(Win32GenEx)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(Win32GenEx-debug-build ${CMAKE_COMMAND} --build ${RunCMake_TEST_BINARY_DIR} --config Debug)
+ run_cmake_command(Win32GenEx-release-build ${CMAKE_COMMAND} --build ${RunCMake_TEST_BINARY_DIR} --config Release)
+ unset(RunCMake_TEST_NO_CLEAN)
+else()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Win32GenEx-debug-build)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ run_cmake(Win32GenEx-debug)
+ unset(RunCMake_TEST_OPTIONS)
+
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(Win32GenEx-debug-build ${CMAKE_COMMAND} --build ${RunCMake_TEST_BINARY_DIR})
+ unset(RunCMake_TEST_NO_CLEAN)
+
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Win32GenEx-release-build)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ run_cmake(Win32GenEx-release)
+ unset(RunCMake_TEST_OPTIONS)
+
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(Win32GenEx-release-build ${CMAKE_COMMAND} --build ${RunCMake_TEST_BINARY_DIR})
+ unset(RunCMake_TEST_NO_CLEAN)
+endif()
diff --git a/Tests/RunCMake/Win32GenEx/Win32GenEx-debug.cmake b/Tests/RunCMake/Win32GenEx/Win32GenEx-debug.cmake
new file mode 100644
index 0000000..74c5bd8
--- /dev/null
+++ b/Tests/RunCMake/Win32GenEx/Win32GenEx-debug.cmake
@@ -0,0 +1 @@
+include(Win32GenEx.cmake)
diff --git a/Tests/RunCMake/Win32GenEx/Win32GenEx-release.cmake b/Tests/RunCMake/Win32GenEx/Win32GenEx-release.cmake
new file mode 100644
index 0000000..74c5bd8
--- /dev/null
+++ b/Tests/RunCMake/Win32GenEx/Win32GenEx-release.cmake
@@ -0,0 +1 @@
+include(Win32GenEx.cmake)
diff --git a/Tests/RunCMake/Win32GenEx/Win32GenEx.cmake b/Tests/RunCMake/Win32GenEx/Win32GenEx.cmake
new file mode 100644
index 0000000..80f8b80
--- /dev/null
+++ b/Tests/RunCMake/Win32GenEx/Win32GenEx.cmake
@@ -0,0 +1,7 @@
+enable_language(C)
+
+add_executable(Win32GenEx main.c)
+set_target_properties(Win32GenEx PROPERTIES
+ WIN32_EXECUTABLE $<CONFIG:Release>
+ )
+target_compile_definitions(Win32GenEx PRIVATE $<$<CONFIG:Release>:USE_WIN32_MAIN>)
diff --git a/Tests/RunCMake/Win32GenEx/main.c b/Tests/RunCMake/Win32GenEx/main.c
new file mode 100644
index 0000000..1cf9f81
--- /dev/null
+++ b/Tests/RunCMake/Win32GenEx/main.c
@@ -0,0 +1,14 @@
+#ifdef USE_WIN32_MAIN
+# include <windows.h>
+
+int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine, int nShowCmd)
+{
+ return 0;
+}
+#else
+int main(void)
+{
+ return 0;
+}
+#endif