diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-23 11:37:53 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-23 13:20:22 +0200 |
commit | e28c988a04c15c2cedfe7e069a066463f4e4c452 (patch) | |
tree | 7eda372353b8d309380ebe1f524e2a136bd818a1 /gui | |
parent | 163c717dec73df7a907821cfb092a2ab6c62286a (diff) |
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.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/CMakeLists.txt | 17 |
1 files changed, 6 insertions, 11 deletions
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) - |