summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-13 09:23:26 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-13 09:23:26 +0100
commit15375537ebafd5b4ff2a1dad6d496ae5f1e1fd5b (patch)
treed437cceb24c3e7f393afbbf15f7ff711240c0fc3
parent9f06603e2d752f574b145bc3c4b5e453d7d306d0 (diff)
cmake: variant work
-rw-r--r--cmake/opentrack-i18n.cmake9
-rw-r--r--cmake/opentrack-variant.cmake5
-rw-r--r--variant/default/main.cpp2
-rw-r--r--variant/trackmouse/CMakeLists.txt10
4 files changed, 20 insertions, 6 deletions
diff --git a/cmake/opentrack-i18n.cmake b/cmake/opentrack-i18n.cmake
index 74d5dcee..7005187c 100644
--- a/cmake/opentrack-i18n.cmake
+++ b/cmake/opentrack-i18n.cmake
@@ -1,4 +1,11 @@
function(otr_i18n_for_target_directory n)
+ get_property(variant GLOBAL PROPERTY opentrack-variant)
+ if(NOT ".${variant}" STREQUAL "default")
+ set(force-skip-update TRUE)
+ else()
+ set(force-skip-update FALSE)
+ endif()
+
set(k "opentrack-${n}")
get_property(lupdate-binary TARGET "${Qt5_LUPDATE_EXECUTABLE}" PROPERTY IMPORTED_LOCATION)
@@ -6,7 +13,7 @@ function(otr_i18n_for_target_directory n)
foreach(i ${opentrack_all-translations})
set(t "${CMAKE_CURRENT_SOURCE_DIR}/lang/${i}.ts")
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY CLEAN_NO_CUSTOM 1)
- if(NOT opentrack_disable-i18n-update)
+ if(maybe-skip-update OR NOT opentrack_disable-i18n-update)
add_custom_command(OUTPUT "${t}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang"
COMMAND "${lupdate-binary}" -silent -recursive -no-obsolete -locations relative . -ts "${t}"
diff --git a/cmake/opentrack-variant.cmake b/cmake/opentrack-variant.cmake
index 7418f882..607aa441 100644
--- a/cmake/opentrack-variant.cmake
+++ b/cmake/opentrack-variant.cmake
@@ -1,8 +1,8 @@
-# set these as cache variables manually
-
set(opentrack_variant "default" CACHE STRING "")
set_property(CACHE opentrack_variant PROPERTY STRINGS "default;trackmouse")
+# XXX that belongs in each variant's directory!
+
function(otr_dist_select_variant)
if(opentrack_variant STREQUAL "trackmouse")
set_property(GLOBAL PROPERTY opentrack-variant "trackmouse")
@@ -17,6 +17,7 @@ function(otr_dist_select_variant)
"logic"
"dinput"
"gui"
+ "pose-widget"
"spline"
"cv"
"migration")
diff --git a/variant/default/main.cpp b/variant/default/main.cpp
index 80f7e495..e539c635 100644
--- a/variant/default/main.cpp
+++ b/variant/default/main.cpp
@@ -16,5 +16,3 @@ int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int /* nCmdShow */)
return main(__argc, __argv);
}
#endif
-
-
diff --git a/variant/trackmouse/CMakeLists.txt b/variant/trackmouse/CMakeLists.txt
index bda9c39b..549b334a 100644
--- a/variant/trackmouse/CMakeLists.txt
+++ b/variant/trackmouse/CMakeLists.txt
@@ -1 +1,9 @@
-message("FATAL_ERROR" "")
+otr_module(executable EXECUTABLE BIN)
+
+set_target_properties(opentrack-executable PROPERTIES
+ SUFFIX "${opentrack-binary-suffix}"
+ OUTPUT_NAME "trackmouse-opentrack"
+ PREFIX ""
+)
+
+target_link_libraries(opentrack-executable opentrack-user-interface)