aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-06-04 10:54:05 +0200
committerStephen Kelly <steveire@gmail.com>2012-06-20 13:54:16 +0200
commit3658ae8e0ffbc61d153115f189a6be14d401708c (patch)
tree55ac150d7f74c4916acbe26c7ab664a5b12d3252
parent535c2fe600aca193d571a935af653d6e1380dbf7 (diff)
downloadextra-cmake-modules-3658ae8e0ffbc61d153115f189a6be14d401708c.tar.gz
extra-cmake-modules-3658ae8e0ffbc61d153115f189a6be14d401708c.tar.bz2
Make non-gui executables by default and provide a function to reverse it.
-rw-r--r--kde-modules/KDECMakeSettings.cmake6
-rw-r--r--modules/ECMMarkNonGuiExecutable.cmake18
2 files changed, 24 insertions, 0 deletions
diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake
index 9f38054a..efbfcfa7 100644
--- a/kde-modules/KDECMakeSettings.cmake
+++ b/kde-modules/KDECMakeSettings.cmake
@@ -94,6 +94,12 @@ if(NOT KDE_SKIP_BUILD_SETTINGS)
unset(ARCHIVE_OUTPUT_DIRECTORY)
unset(LIBRARY_OUTPUT_DIRECTORY)
unset(RUNTIME_OUTPUT_DIRECTORY)
+
+ # By default, create 'GUI' executables. This can be reverted on a per-target basis
+ # using ECMMarkNonGuiExecutable
+ set(CMAKE_WIN32_EXECUTABLE ON)
+ set(CMAKE_MACOSX_BUNDLE ON)
+
# under Windows, generate all executables and libraries into
# one common directory, so the executables find their dlls
if(WIN32)
diff --git a/modules/ECMMarkNonGuiExecutable.cmake b/modules/ECMMarkNonGuiExecutable.cmake
new file mode 100644
index 00000000..3c199ab5
--- /dev/null
+++ b/modules/ECMMarkNonGuiExecutable.cmake
@@ -0,0 +1,18 @@
+# - Function for marking executables as being non-gui
+# This module provides the function ECM_MARK_NONGUI_EXECUTABLE().
+#
+# The ECM_MARK_NONGUI_EXECUTABLE function is used to indicate that an executable
+# target should not be part of a MACOSX_BUNDLE, and should not be a WIN32_EXECUTABLE.
+#
+# ECM_MARK_NONGUI_EXECUTABLE( target1 target2 ... targetN )
+#
+
+function(ecm_mark_nongui_executable)
+ foreach(_target ${ARGN})
+ set_target_properties(${_target}
+ PROPERTIES
+ WIN32_EXECUTABLE FALSE
+ MACOSX_BUNDLE FALSE
+ )
+ endforeach()
+endfunction()