#------------------------------------------------------------------- # This file is part of the CMake build system for Scol # # The contents of this file are placed in the public domain. Feel # free to make use of it in any way you like. #------------------------------------------------------------------- ############################################################ # CmakeList file for sensor plugin ############################################################ PROJECT(sensor) if (NOT ANDROID) if (Scol_BUILD_WITH_QT) set(SCOL_USE_QT TRUE) elseif (Scol_BUILD_WITH_SDL) set(SCOL_USE_SDL TRUE) elseif (UNIX OR APPLE) # default set(SCOL_USE_QT TRUE) endif() endif(NOT ANDROID) # define header and source files for the library if (ANDROID) set (SENSOR_HEADER_FILES include/SASensor.h ) set (SENSOR_SOURCE_FILES src/SASensor.cpp ) elseif (WIN32) set (SENSOR_HEADER_FILES include/SWSensor.h ) set (SENSOR_SOURCE_FILES src/SWSensor.cpp ) elseif (SCOL_USE_QT) set (SENSOR_HEADER_FILES include/SQSensor.h ) set (SENSOR_SOURCE_FILES src/SQSensor.cpp ) elseif (SCOL_USE_SDL) set (SENSOR_HEADER_FILES include/SSDLSensor.h ) set (SENSOR_SOURCE_FILES src/SSDLSensor.cpp ) endif () # define header and source files for the library set (SENSOR_HEADER_FILES ${SENSOR_HEADER_FILES} include/SSensor.h include/orientationTracker.h include/tools/Matrix3x3d.h include/tools/Matrix4.h include/tools/OrientationEKF.h include/tools/SO3Util.h include/tools/Vector3d.h include/tools/Quaternion.h include/tools/lowPassFilter.h include/tools/gyroscopeBiasEstimator.h ) if (Scol_STATIC) set (SENSOR_HEADER_FILES ${SENSOR_HEADER_FILES} include/loadScolSensor.h) endif() set (SENSOR_SOURCE_FILES ${SENSOR_SOURCE_FILES} src/SSensor.cpp src/scolplugin.cpp src/orientationTracker.cpp src/tools/Matrix3x3d.cpp src/tools/Matrix4.cpp src/tools/orientationEKF.cpp src/tools/SO3Util.cpp src/tools/Vector3d.cpp src/tools/Quaternion.cpp src/tools/lowPassFilter.cpp src/tools/gyroscopeBiasEstimator.cpp ) scol_include_plugin("SENSOR" "${PROJECT_SOURCE_DIR}/include" "loadScolSensor.h") # Add directories includes if (SCOL_USE_QT) add_definitions(-DSCOL_QT) elseif (SCOL_USE_SDL) add_definitions(-DSCOL_SDL) endif () # Add definition for P4 optimizations, warnings removal. add_definitions(-DOPTI_P4 -D_CRT_SECURE_NO_WARNINGS -DUSE_SSLEAY -DUSE_OPENSSL -DCURL_STATICLIB) include_directories(include ${SENSOR_INCLUDE_DIRS}) set(SENSOR_LIBRARIES "") # setup Scol plugin target add_library(sensor ${Scol_LIB_TYPE} ${SENSOR_HEADER_FILES} ${SENSOR_SOURCE_FILES} ) add_dependencies(sensor kernel) if (ANDROID) set(SENSOR_LIBRARIES ${SENSOR_LIBRARIES} ndk_helper log android cpufeatures native_app_glue) set(Scol_ANDROID_DEPENDENCIES ${Scol_ANDROID_DEPENDENCIES} sensor CACHE INTERNAL "" FORCE) message(STATUS "[${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}] Scol_ANDROID_DEPENDENCIES: ${Scol_ANDROID_DEPENDENCIES} -- added SENSOR to android project deps") elseif(APPLE) if(SCOL_USE_QT) if (NOT Qt5Widgets_FOUND) set(QtModule "Widgets") #find_host_package(Qt5 COMPONENTS Widgets Sensors REQUIRED) endif() if (NOT Qt5Sensors_FOUND) set(QtModule "Sensors") find_host_package(Qt5 REQUIRED) endif() set(SENSOR_LIBRARIES ${SENSOR_LIBRARIES} Qt5::Widgets ${Qt5Widgets_STATIC_DEPS}) if (NOT Qt5Sensors_FOUND) find_host_package(Qt5 COMPONENTS Sensors REQUIRED) endif() set(SENSOR_LIBRARIES ${SENSOR_LIBRARIES} ${Qt5Sensors_STATIC_DEPS}) set_target_properties(sensor PROPERTIES AUTOMOC ON) elseif(SCOL_USE_SDL) if (NOT SDL2_FOUND) find_host_package(SDL2 REQUIRED) endif() set(SENSOR_LIBRARIES ${SENSOR_LIBRARIES} ${SDL2_LIBRARIES}) include_directories(${SDL2_INCLUDE_DIRS}) endif() elseif(SCOL_USE_QT) if (NOT Qt5Sensors_FOUND) find_package(Qt5 COMPONENTS Core Widgets Sensors REQUIRED) endif() set(SENSOR_LIBRARIES ${SENSOR_LIBRARIES} Qt5::Widgets Qt5::Sensors) set_target_properties(sensor PROPERTIES AUTOMOC ON) elseif(SCOL_USE_SDL) if (NOT SDL2_FOUND) find_host_package(SDL2 REQUIRED) endif() set(SENSOR_LIBRARIES ${SENSOR_LIBRARIES} ${SDL2_LIBRARIES}) include_directories(${SDL2_INCLUDE_DIRS}) endif() if (WIN32) set(SENSOR_LIBRARIES ${SENSOR_LIBRARIES} Sensorsapi) endif() # set the dll version. #set_target_properties(sensor PROPERTIES VERSION ${Scol_VERSION} SOVERSION ${Scol_VERSION_MAJOR}) target_link_libraries(sensor ${SENSOR_LIBRARIES} ${Boost_LIBRARIES}) # install Scol scol_config_plugin(sensor) #install(FILES ${SENSOR_HEADER_FILES} DESTINATION include/SCOL/plugins/sensor)