From: Thomas Debesse Date: Fri, 5 Jul 2019 20:25:34 +0000 (+0200) Subject: cmake: do not use WIN32 for console tools X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=commitdiff_plain;h=0f91bcf305ef8707b4a96a764c09aeb3cb6beba3 cmake: do not use WIN32 for console tools allow them to output stdout on console and spawn a console if required it's not very intuitive and explicit but the WIN32 cmake keyword in add_executable call is to not target the console subsystem but only the graphical one so console tools just have to not use that keyword, even if they imay display a window like when doing q2map -glview then the WIN32 keyword is a kind of “no console” keyword --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6afa468a..1a414aa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,18 +266,6 @@ if (BUILD_BINARIES) string(REGEX REPLACE "^[.]" "" RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX}) endif () - macro (console_app name) - if (WIN32) - target_link_libraries(${name} -mconsole) - endif () - endmacro () - - macro (window_app name) - if (WIN32) - target_link_libraries(${name} -mwindows) - endif () - endmacro () - macro (radiant_tool name) if (BUNDLE_LIBRARIES AND WIN32) add_executable(${name} ${ARGN} ${PROJECT_SOURCE_DIR}/include/lib.rc) diff --git a/radiant/CMakeLists.txt b/radiant/CMakeLists.txt index 144bf320..93fedea4 100644 --- a/radiant/CMakeLists.txt +++ b/radiant/CMakeLists.txt @@ -128,8 +128,6 @@ target_link_libraries(${RADIANT_BASENAME} xmllib ) -window_app(${RADIANT_BASENAME}) - if (X11_LIBRARIES) target_link_libraries(${RADIANT_BASENAME} ${X11_LIBRARIES}) endif () diff --git a/tools/quake2/CMakeLists.txt b/tools/quake2/CMakeLists.txt index 20d7ff82..b36be1ae 100644 --- a/tools/quake2/CMakeLists.txt +++ b/tools/quake2/CMakeLists.txt @@ -4,7 +4,7 @@ find_package(LibXml2 REQUIRED) include_directories(${LIBXML2_INCLUDE_DIR}) radiant_tool(q2map - WIN32 q2map/q2map.rc + q2map/q2map.rc common/bspfile.c common/bspfile.h common/cmdlib.c common/cmdlib.h @@ -46,9 +46,6 @@ radiant_tool(q2map q2map/writebsp.c ) -console_app(q2map) -window_app(q2map) - target_compile_definitions(q2map PRIVATE ) @@ -59,7 +56,7 @@ target_link_libraries(q2map ) radiant_tool(qdata3 - WIN32 qdata/qdata.rc + qdata/qdata.rc common/bspfile.c common/bspfile.h common/cmdlib.c common/cmdlib.h @@ -84,8 +81,6 @@ radiant_tool(qdata3 qdata/video.c ) -console_app(qdata3) - target_compile_definitions(qdata3 PRIVATE ) diff --git a/tools/quake2/qdata_heretic2/CMakeLists.txt b/tools/quake2/qdata_heretic2/CMakeLists.txt index d9c5b436..34131623 100644 --- a/tools/quake2/qdata_heretic2/CMakeLists.txt +++ b/tools/quake2/qdata_heretic2/CMakeLists.txt @@ -6,7 +6,7 @@ find_package(LibXml2 REQUIRED) include_directories(${LIBXML2_INCLUDE_DIR}) radiant_tool(h2data - WIN32 h2data.rc + h2data.rc common/bspfile.c common/bspfile.h common/cmdlib.c common/cmdlib.h @@ -56,8 +56,6 @@ radiant_tool(h2data video.c ) -console_app(h2data) - target_compile_definitions(h2data PRIVATE ) diff --git a/tools/quake3/CMakeLists.txt b/tools/quake3/CMakeLists.txt index d2d3ae2b..41af91c5 100644 --- a/tools/quake3/CMakeLists.txt +++ b/tools/quake3/CMakeLists.txt @@ -60,7 +60,7 @@ set(q3map2_games ) radiant_tool(q3map2 - WIN32 q3map2/q3map2.rc + q3map2/q3map2.rc common/cmdlib.c common/cmdlib.h common/imagelib.c common/imagelib.h @@ -127,8 +127,6 @@ radiant_tool(q3map2 q3map2/writebsp.c ) -console_app(q3map2) - if (BUILD_CRUNCH) set(OPTIONAL_IMAGE_LIBRARIES crnrgba) set(OPTIONAL_IMAGE_DEFINES BUILD_CRUNCH=1) @@ -157,7 +155,7 @@ target_link_libraries(q3map2 ) radiant_tool(q3data - WIN32 q3data/q3data.rc + q3data/q3data.rc common/aselib.c common/aselib.h common/bspfile.c common/bspfile.h @@ -181,8 +179,6 @@ radiant_tool(q3data q3data/video.c ) -console_app(q3data) - target_link_libraries(q3data ${GLIB_LIBRARIES} ${LIBXML2_LIBRARIES}