diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/opentrack-boilerplate.cmake | 26 | ||||
-rw-r--r-- | cmake/opentrack-hier.cmake | 56 | ||||
-rw-r--r-- | cmake/opentrack-i18n.cmake | 4 | ||||
-rw-r--r-- | cmake/opentrack-install.cmake | 46 | ||||
-rw-r--r-- | cmake/opentrack-opencv.cmake | 2 |
5 files changed, 67 insertions, 67 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index 958403cc..a78e0ed0 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -18,10 +18,10 @@ set(new-hier-path "#pragma once #endif #define OPENTRACK_LIBRARY_PREFIX \"\" -#define OPENTRACK_LIBRARY_PATH \"${opentrack-hier-path}\" -#define OPENTRACK_DOC_PATH \"${opentrack-hier-doc}\" -#define OPENTRACK_CONTRIB_PATH \"${opentrack-hier-doc}contrib/\" -#define OPENTRACK_I18N_PATH \"${opentrack-i18n-path}\" +#define OPENTRACK_LIBRARY_PATH \"${opentrack-runtime-libexec}\" +#define OPENTRACK_DOC_PATH \"${opentrack-runtime-doc}\" +#define OPENTRACK_CONTRIB_PATH \"${opentrack-runtime-doc}contrib/\" +#define OPENTRACK_I18N_PATH \"${opentrack-runtime-i18n}\" ") function(otr_write_library_paths) @@ -109,7 +109,7 @@ endfunction() function(otr_install_pdb_current_project target) if(MSVC) - install(FILES "$<TARGET_PDB_FILE:${target}>" DESTINATION "${opentrack-hier-debug}" PERMISSIONS ${opentrack-perms-file}) + install(FILES "$<TARGET_PDB_FILE:${target}>" DESTINATION "${opentrack-debug}" PERMISSIONS ${opentrack-perms-file}) endif() endfunction() @@ -222,20 +222,20 @@ function(otr_module n_) if(arg_BIN) if (APPLE) install(TARGETS "${n}" - RUNTIME DESTINATION ${opentrack-hier-bin} - BUNDLE DESTINATION ${opentrack-hier-bin} - LIBRARY DESTINATION ${opentrack-hier-bin}/Library - RESOURCE DESTINATION ${opentrack-hier-bin}/opentrack.app/Resource + RUNTIME DESTINATION ${opentrack-bin} + BUNDLE DESTINATION ${opentrack-bin} + LIBRARY DESTINATION ${opentrack-bin}/Library + RESOURCE DESTINATION ${opentrack-bin}/opentrack.app/Resource PERMISSIONS ${opentrack-perms-exec}) else() install(TARGETS "${n}" - RUNTIME DESTINATION ${opentrack-hier-bin} - LIBRARY DESTINATION ${opentrack-hier-pfx} + RUNTIME DESTINATION ${opentrack-bin} + LIBRARY DESTINATION ${opentrack-libexec} PERMISSIONS ${opentrack-perms-exec}) endif() else() # Plugins - install(TARGETS "${n}" ${opentrack-hier-str} + install(TARGETS "${n}" ${opentrack-install-src} PERMISSIONS ${opentrack-perms-exec}) endif() @@ -295,7 +295,7 @@ function(otr_install_lib target dest) set(pdb-path "") otr_pdb_for_dll(pdb-path "${path}") if(pdb-path) - install(FILES "${pdb-path}" DESTINATION "${opentrack-hier-debug}" PERMISSIONS ${opentrack-perms-exec}) + install(FILES "${pdb-path}" DESTINATION "${opentrack-debug}" PERMISSIONS ${opentrack-perms-exec}) endif() endif() install(FILES "${path}" DESTINATION "${dest}" PERMISSIONS ${opentrack-perms-exec}) diff --git a/cmake/opentrack-hier.cmake b/cmake/opentrack-hier.cmake index 13f876a5..16694d1f 100644 --- a/cmake/opentrack-hier.cmake +++ b/cmake/opentrack-hier.cmake @@ -10,45 +10,45 @@ include_guard(GLOBAL) if(APPLE) - set(opentrack-hier-pfx "Plugins") - set(opentrack-hier-path "/Plugins/") # MUST HAVE A TRAILING BACKSLASH, Used in APP - set(opentrack-hier-doc "/") # MUST HAVE A TRAILING BACKSLASH - set(opentrack-hier-bin "${CMAKE_INSTALL_PREFIX}") - set(opentrack-doc-pfx "./doc") - set(opentrack-doc-src-pfx "./source-code") - set(opentrack-i18n-pfx "opentrack.app/Contents/Resources") # used during install - set(opentrack-i18n-path "../Resources/i18n") # used in application + set(opentrack-libexec "Plugins") + set(opentrack-runtime-libexec "/Plugins/") # MUST HAVE A TRAILING BACKSLASH, Used in APP + set(opentrack-runtime-doc "/") # MUST HAVE A TRAILING BACKSLASH + set(opentrack-bin "${CMAKE_INSTALL_PREFIX}") + set(opentrack-doc "./doc") + set(opentrack-src "./source-code") + set(opentrack-i18n "opentrack.app/Contents/Resources") # used during install + set(opentrack-runtime-i18n "../Resources/i18n") # used in application set(opentrack-install-rpath "${CMAKE_INSTALL_PREFIX}/Library") elseif(WIN32) - set(opentrack-hier-pfx "modules") - set(opentrack-hier-path "/${opentrack-hier-pfx}/") # MUST HAVE A TRAILING BACKSLASH - set(opentrack-hier-doc "/doc/") # MUST HAVE A TRAILING BACKSLASH - set(opentrack-hier-bin ".") - set(opentrack-doc-pfx "./doc") - set(opentrack-doc-src-pfx "./source-code") - set(opentrack-i18n-pfx "./i18n") - set(opentrack-i18n-path "./i18n") - set(opentrack-hier-debug "./debug") + set(opentrack-libexec "modules") + set(opentrack-runtime-libexec "/${opentrack-libexec}/") # MUST HAVE A TRAILING BACKSLASH + set(opentrack-runtime-doc "/doc/") # MUST HAVE A TRAILING BACKSLASH + set(opentrack-bin ".") + set(opentrack-doc "./doc") + set(opentrack-src "./source-code") + set(opentrack-i18n "./i18n") + set(opentrack-runtime-i18n "./i18n") + set(opentrack-debug "./debug") set(opentrack-install-rpath "") else() - set(opentrack-hier-pfx "libexec/opentrack") - set(opentrack-hier-path "/../${opentrack-hier-pfx}/") # MUST HAVE A TRAILING BACKSLASH - set(opentrack-hier-doc "/share/doc/opentrack/") # MUST HAVE A TRAILING BACKSLASH - set(opentrack-hier-bin "bin") - set(opentrack-doc-pfx "./share/doc/opentrack") - set(opentrack-doc-src-pfx "./share/doc/opentrack/source-code") - set(opentrack-install-rpath "${CMAKE_INSTALL_PREFIX}/${opentrack-hier-pfx}") - set(opentrack-i18n-pfx "./share/opentrack/i18n") - set(opentrack-i18n-path "../share/opentrack/i18n") + set(opentrack-libexec "libexec/opentrack") + set(opentrack-runtime-libexec "/../${opentrack-libexec}/") # MUST HAVE A TRAILING BACKSLASH + set(opentrack-runtime-doc "/share/doc/opentrack/") # MUST HAVE A TRAILING BACKSLASH + set(opentrack-bin "bin") + set(opentrack-doc "./share/doc/opentrack") + set(opentrack-src "./share/doc/opentrack/source-code") + set(opentrack-install-rpath "${CMAKE_INSTALL_PREFIX}/${opentrack-libexec}") + set(opentrack-i18n "./share/opentrack/i18n") + set(opentrack-runtime-i18n "../share/opentrack/i18n") endif() -set(opentrack-hier-str RUNTIME DESTINATION ${opentrack-hier-pfx} LIBRARY DESTINATION ${opentrack-hier-pfx}) +set(opentrack-install-src RUNTIME DESTINATION ${opentrack-libexec} LIBRARY DESTINATION ${opentrack-libexec}) function(otr_escape_string var str) string(REGEX REPLACE "([^_A-Za-z0-9./:-])" "\\\\\\1" str "${str}") set(${var} "${str}" PARENT_SCOPE) endfunction() -set(opentrack-contrib-pfx "${opentrack-doc-pfx}/contrib") +set(opentrack-contrib-pfx "${opentrack-doc}/contrib") set(opentrack-binary-suffix "") if(WIN32) diff --git a/cmake/opentrack-i18n.cmake b/cmake/opentrack-i18n.cmake index 398f59a4..f3b53895 100644 --- a/cmake/opentrack-i18n.cmake +++ b/cmake/opentrack-i18n.cmake @@ -58,7 +58,7 @@ function(otr_i18n_for_target_directory n) endfunction() function(otr_merge_translations) - otr_escape_string(i18n-pfx "${opentrack-i18n-pfx}") + otr_escape_string(i18n-pfx "${opentrack-i18n}") install(CODE "file(REMOVE_RECURSE \"\${CMAKE_INSTALL_PREFIX}/${i18n-pfx}\")") foreach(i ${opentrack_all-translations}) @@ -92,7 +92,7 @@ function(otr_merge_translations) add_dependencies(i18n-lrelease ${target-name}) install(FILES "${qm-output}" - DESTINATION "${CMAKE_INSTALL_PREFIX}/${opentrack-i18n-pfx}" + DESTINATION "${CMAKE_INSTALL_PREFIX}/${opentrack-i18n}" PERMISSIONS ${opentrack-perms-file}) endforeach() endfunction() diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake index d464936c..94f3e29d 100644 --- a/cmake/opentrack-install.cmake +++ b/cmake/opentrack-install.cmake @@ -17,8 +17,8 @@ macro(otr_install_dir path) endmacro() function(otr_setup_refresh_install_dir) - if((NOT CMAKE_INSTALL_PREFIX STREQUAL "") AND (NOT opentrack-doc-src-pfx STREQUAL "")) - otr_escape_string(dir "${CMAKE_INSTALL_PREFIX}/${opentrack-doc-src-pfx}/") + if((NOT CMAKE_INSTALL_PREFIX STREQUAL "") AND (NOT opentrack-src STREQUAL "")) + otr_escape_string(dir "${CMAKE_INSTALL_PREFIX}/${opentrack-src}/") install(CODE "file(REMOVE_RECURSE \"${dir}\")") endif() endfunction() @@ -28,18 +28,18 @@ function(otr_install_sources) get_property(source-dirs GLOBAL PROPERTY opentrack-all-source-dirs) foreach(k ${source-dirs}) file(RELATIVE_PATH dest "${CMAKE_SOURCE_DIR}" "${k}") - otr_install_dir("${opentrack-doc-src-pfx}" "${dest}") + otr_install_dir("${opentrack-src}" "${dest}") endforeach() - otr_install_dir("${opentrack-doc-src-pfx}" "${CMAKE_SOURCE_DIR}/cmake") - otr_install_dir("${opentrack-doc-src-pfx}" "${CMAKE_SOURCE_DIR}/bin") + otr_install_dir("${opentrack-src}" "${CMAKE_SOURCE_DIR}/cmake") + otr_install_dir("${opentrack-src}" "${CMAKE_SOURCE_DIR}/bin") - otr_install_misc("${opentrack-doc-src-pfx}" FILES "${CMAKE_SOURCE_DIR}/CMakeLists.txt") - otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/README.md") - otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/.github/CONTRIBUTING.md") - otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/WARRANTY.txt") - otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/OPENTRACK-LICENSING.txt") - otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/AUTHORS.md") + otr_install_misc("${opentrack-src}" FILES "${CMAKE_SOURCE_DIR}/CMakeLists.txt") + otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/README.md") + otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/.github/CONTRIBUTING.md") + otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/WARRANTY.txt") + otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/OPENTRACK-LICENSING.txt") + otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/AUTHORS.md") endfunction() function(cleanup_visual_studio_debug) @@ -47,22 +47,22 @@ function(cleanup_visual_studio_debug) install(CODE "file(REMOVE_RECURSE \"${pfx}/.vs\")") endfunction() -otr_install_dir("${opentrack-doc-pfx}" ${CMAKE_SOURCE_DIR}/3rdparty-notices) -otr_install_dir("${opentrack-doc-pfx}" "${CMAKE_SOURCE_DIR}/settings" "${CMAKE_SOURCE_DIR}/contrib") +otr_install_dir("${opentrack-doc}" ${CMAKE_SOURCE_DIR}/3rdparty-notices) +otr_install_dir("${opentrack-doc}" "${CMAKE_SOURCE_DIR}/settings" "${CMAKE_SOURCE_DIR}/contrib") if(WIN32) otr_install_misc(. FILES "${CMAKE_SOURCE_DIR}/bin/qt.conf") otr_install_misc(. FILES "${CMAKE_SOURCE_DIR}/bin/cleye.config") - otr_install_misc(${opentrack-hier-pfx} FILES "${CMAKE_SOURCE_DIR}/bin/cleye.config") + otr_install_misc(${opentrack-libexec} FILES "${CMAKE_SOURCE_DIR}/bin/cleye.config") endif() -otr_install_misc("${opentrack-doc-pfx}" FILES ${CMAKE_SOURCE_DIR}/README.md) +otr_install_misc("${opentrack-doc}" FILES ${CMAKE_SOURCE_DIR}/README.md) -otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/README.md") -otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/.github/CONTRIBUTING.md") -otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/WARRANTY.txt") -otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/OPENTRACK-LICENSING.txt") -otr_install_misc("${opentrack-doc-pfx}" FILES "${CMAKE_SOURCE_DIR}/AUTHORS.md") +otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/README.md") +otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/.github/CONTRIBUTING.md") +otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/WARRANTY.txt") +otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/OPENTRACK-LICENSING.txt") +otr_install_misc("${opentrack-doc}" FILES "${CMAKE_SOURCE_DIR}/AUTHORS.md") # this must be done last because the files may be in use already # do it last so in case of file-in-use failure, the rest is installed @@ -75,9 +75,9 @@ endif() if (APPLE) set(OSX_POST_INSTALL_DIR "/../thirdparty") endif() -otr_install_exec("${opentrack-hier-pfx}${OSX_POST_INSTALL_DIR}" FILES "${CMAKE_SOURCE_DIR}/bin/freetrackclient.dll") -otr_install_exec("${opentrack-hier-pfx}${OSX_POST_INSTALL_DIR}" FILES "${CMAKE_SOURCE_DIR}/bin/freetrackclient64.dll") -otr_install_exec("${opentrack-hier-pfx}${OSX_POST_INSTALL_DIR}" FILES +otr_install_exec("${opentrack-libexec}${OSX_POST_INSTALL_DIR}" FILES "${CMAKE_SOURCE_DIR}/bin/freetrackclient.dll") +otr_install_exec("${opentrack-libexec}${OSX_POST_INSTALL_DIR}" FILES "${CMAKE_SOURCE_DIR}/bin/freetrackclient64.dll") +otr_install_exec("${opentrack-libexec}${OSX_POST_INSTALL_DIR}" FILES "${CMAKE_SOURCE_DIR}/bin/NPClient.dll" "${CMAKE_SOURCE_DIR}/bin/NPClient64.dll" "${CMAKE_SOURCE_DIR}/bin/TrackIR.exe") diff --git a/cmake/opentrack-opencv.cmake b/cmake/opentrack-opencv.cmake index b8c3701c..40356418 100644 --- a/cmake/opentrack-opencv.cmake +++ b/cmake/opentrack-opencv.cmake @@ -5,7 +5,7 @@ find_package(OpenCV QUIET) function(otr_install_opencv_libs) foreach(k core features2d calib3d flann imgcodecs imgproc videoio) - otr_install_lib("opencv_${k}" "${opentrack-hier-pfx}") + otr_install_lib("opencv_${k}" "${opentrack-libexec}") endforeach() endfunction() |