From e28c988a04c15c2cedfe7e069a066463f4e4c452 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 23 Aug 2016 11:37:53 +0200 Subject: cmake: refactor boilerplate for projects Don't rely on a macro that shouldn't be necessary. The information "opentrack_boilerplate" retrieves is now factored out to be easily available to projects themselves. opentrack_boilerplate can now also build executables. When appropriate, target properties are now concatenated rather than replaced. --- gui/CMakeLists.txt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'gui') diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 6fa8d034..90d1c34f 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -1,16 +1,14 @@ -opentrack_boilerplate(opentrack NO-LIBRARY) +if(MSVC OR (NOT SDK_CONSOLE_DEBUG AND WIN32)) + set(console "") +else() + set(console WIN32-CONSOLE) +endif() if(WIN32) SET(SDK_CONSOLE_DEBUG FALSE CACHE BOOL "Console window visible at runtime") endif() -if(WIN32 AND NOT SDK_CONSOLE_DEBUG) - set(opentrack-win32-executable WIN32) -else() - set(opentrack-win32-executable "") -endif() - -add_executable(opentrack ${opentrack-win32-executable} ${opentrack-all}) +opentrack_boilerplate(opentrack EXECUTABLE ${console}) set_target_properties(opentrack PROPERTIES SUFFIX "${opentrack-binary-suffix}") @@ -31,6 +29,3 @@ if(LINUX) # for process detector target_link_libraries(opentrack procps) endif() - -opentrack_boilerplate(opentrack STAGE2 BIN) - -- cgit v1.2.3