summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-12-14 15:46:54 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-12-14 15:46:54 +0100
commitb0b5db6bcf762928e1278488f14819cd2e9a0cd9 (patch)
treea633ab9145bb2fe2baa6c9d4a141edd4ab5c37ec
parent982138ba2c308ee66e33bb67eea9d66f708e021e (diff)
hatire cache val; not every dist has qt5serialport
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
-rw-r--r--CMakeLists.txt35
1 files changed, 26 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d760937f..eff5edaf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,8 @@ if(APPLE)
set(CMAKE_CXX_FLAGS " -stdlib=libc++ -std=c++11 ${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif()
+set(SDK_HATIRE TRUE CACHE BOOL "hatire: generic Arduino over serial port")
+
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_SKIP_INSTALL_RPATH FALSE)
@@ -109,7 +111,12 @@ if(MINGW)
endif()
find_package(OpenCV REQUIRED)
- find_package(Qt5 REQUIRED COMPONENTS Core Xml Network Widgets Gui SerialPort QUIET)
+ set(maybe-serial-port)
+ if(SDK_HATIRE)
+ set(maybe-serial-port SerialPort)
+ endif()
+
+ find_package(Qt5 REQUIRED COMPONENTS Core Xml Network Widgets Gui ${maybe-serial-port} QUIET)
cmake_policy(SET CMP0020 NEW)
include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS})
@@ -392,10 +399,18 @@ endif()
if(APPLE)
link_directories(${CMAKE_INSTALL_PREFIX})
- set(MY_QT_LIBS Qt5Widgets Qt5Gui Qt5Network Qt5Xml Qt5Core Qt5SerialPort ${my-qt-deps})
+ set(maybe-hatire)
+ if(SDK_HATIRE)
+ set(maybe-hatire Qt5SerialPort)
+ endif()
+ set(MY_QT_LIBS Qt5Widgets Qt5Gui Qt5Network Qt5Xml Qt5Core ${maybe-hatire} ${my-qt-deps})
else()
+ set(maybe-hatire)
+ if(SDK_HATIRE)
+ set(maybe-hatire ${Qt5SerialPort_LIBRARIES})
+ endif()
SET(MY_QT_LIBS ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES}
- ${Qt5Network_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5SerialPort_LIBRARIES} ${my-qt-deps})
+ ${Qt5Network_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Core_LIBRARIES} ${maybe-hatire} ${my-qt-deps})
endif()
add_library(opentrack-csv SHARED ${opentrack-csv-c} ${opentrack-csv-h})
@@ -564,12 +579,14 @@ if(SDK_ARUCO_LIBPATH)
endif()
endif()
-add_library(opentrack-tracker-hatire SHARED ${opentrack-tracker-hatire-c} ${opentrack-tracker-hatire-h} ${opentrack-tracker-hatire-moc} ${opentrack-tracker-hatire-uih} ${opentrack-tracker-hatire-rcc})
-target_link_libraries(opentrack-tracker-hatire ${MY_QT_LIBS})
-install(TARGETS opentrack-tracker-hatire RUNTIME DESTINATION . LIBRARY DESTINATION . )
-if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
- SET_TARGET_PROPERTIES(opentrack-tracker-hatire
- PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/${version-script}-version-script.txt")
+if(SDK_HATIRE)
+ add_library(opentrack-tracker-hatire SHARED ${opentrack-tracker-hatire-c} ${opentrack-tracker-hatire-h} ${opentrack-tracker-hatire-moc} ${opentrack-tracker-hatire-uih} ${opentrack-tracker-hatire-rcc})
+ target_link_libraries(opentrack-tracker-hatire ${MY_QT_LIBS})
+ install(TARGETS opentrack-tracker-hatire RUNTIME DESTINATION . LIBRARY DESTINATION . )
+ if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
+ SET_TARGET_PROPERTIES(opentrack-tracker-hatire
+ PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/${version-script}-version-script.txt")
+ endif()
endif()
if(WIN32)