diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-18 10:10:56 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-18 10:10:56 +0200 |
commit | 87d577d17be72d5c76571aac001163f80ba912f6 (patch) | |
tree | 679783dd8611b4f9a99617e0507fd6b5b22d4eca /cmake/opentrack-boilerplate.cmake | |
parent | 83bc8af3aae80723c18fbcd905a5347347314546 (diff) |
cmake: allow for installing a dll alongside the main executable
Diffstat (limited to 'cmake/opentrack-boilerplate.cmake')
-rw-r--r-- | cmake/opentrack-boilerplate.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index ecc3128d..fc91e469 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -52,7 +52,7 @@ endfunction() include(CMakeParseArguments) -function(opentrack_boilerplate__ n files_ no-library_ static_ no-compat_ compile_ link_ stage2_) +function(opentrack_boilerplate__ n files_ no-library_ static_ no-compat_ compile_ link_ stage2_ bin_) if((NOT no-library_) AND (NOT stage2_)) set(link-mode SHARED) if (static_) @@ -93,13 +93,17 @@ function(opentrack_boilerplate__ n files_ no-library_ static_ no-compat_ compile string(REPLACE "-" "_" n_ ${n_}) target_compile_definitions(${n} PRIVATE "BUILD_${n_}") if((NOT static_) AND (NOT no-library_)) - install(TARGETS ${n} ${opentrack-hier-str}) + if(bin_ AND WIN32) + install(TARGETS ${n} RUNTIME DESTINATION . LIBRARY DESTINATION .) + else() + install(TARGETS ${n} ${opentrack-hier-str}) + endif() endif() endfunction() macro(opentrack_boilerplate n) cmake_parse_arguments(${n}-args - "NO-LIBRARY;STATIC;NO-COMPAT;STAGE2" + "NO-LIBRARY;STATIC;NO-COMPAT;STAGE2;BIN" "LINK;COMPILE" "" ${ARGN} @@ -119,6 +123,7 @@ macro(opentrack_boilerplate n) "${${n}-args_NO-COMPAT}" "${${n}-args_COMPILE}" "${${n}-args_LINK}" - "${${n}-args_STAGE2}") + "${${n}-args_STAGE2}" + "${${n}-args_BIN}") endif() endmacro() |