summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-boilerplate.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-06 07:37:47 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-06 12:07:48 +0200
commit069ebb6212aa096adb1ded0823ac4194db9b0d03 (patch)
treea31c1026a6a0349e7867713ca85e83e8ff79b1be /cmake/opentrack-boilerplate.cmake
parent56e9f634d5dd4122278a8f1c5f8e9fe39ed3652e (diff)
gui, api, csv: support hier(7) on Unix
This affects platforms such as FreeBSD, Cygwin or Linux.
Diffstat (limited to 'cmake/opentrack-boilerplate.cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake18
1 files changed, 17 insertions, 1 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 3838ca41..54643c42 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -1,3 +1,18 @@
+include(opentrack-hier)
+
+set(new-hier-path "#pragma once
+#define OPENTRACK_LIBRARY_PATH \"${opentrack-hier-path}\"
+")
+
+set(hier-path-filename "${CMAKE_BINARY_DIR}/opentrack-library-path.h")
+set(orig-hier-path "")
+if(EXISTS ${hier-path-filename})
+ file(READ ${hier-path-filename} orig-hier-path)
+endif()
+if(NOT (orig-hier-path STREQUAL new-hier-path))
+ file(WRITE ${hier-path-filename} "${new-hier-path}")
+endif()
+
function(opentrack_set_globs n)
set(dir ${PROJECT_SOURCE_DIR})
file(GLOB ${n}-c ${dir}/*.cpp ${dir}/*.c ${dir}/*.h ${dir}/*.hpp)
@@ -42,6 +57,7 @@ function(opentrack_boilerplate__ n files_ no-library_ static_ no-compat_ compile
set(link-mode STATIC)
endif()
add_library(${n} ${link-mode} ${files_})
+ message(STATUS "module ${n}")
endif()
if(NOT no-library_)
opentrack_compat(${n})
@@ -75,7 +91,7 @@ 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} RUNTIME DESTINATION . LIBRARY DESTINATION .)
+ install(TARGETS ${n} ${opentrack-hier-str})
endif()
endfunction()