[1] | 1 | ######################################################################################################
|
---|
| 2 | # #
|
---|
| 3 | # __________ _________ #
|
---|
| 4 | # \______ \_____ ____ ______ __ __ ______/ _____/ ____ ____ _________________ ______ #
|
---|
| 5 | # | ___/\__ \ _/ ___\\____ \| | \/ ___/\_____ \_/ __ \ / \ / ___/ _ \_ __ \/ ___/ #
|
---|
| 6 | # | | / __ \\ \___| |_> > | /\___ \ / \ ___/| | \\___ ( <_> ) | \/\___ \ #
|
---|
| 7 | # |____| (____ /\___ > __/|____//____ >_______ /\___ >___| /____ >____/|__| /____ > #
|
---|
| 8 | # \/ \/|__| \/ \/ \/ \/ \/ \/ #
|
---|
| 9 | # #
|
---|
| 10 | ######################################################################################################
|
---|
| 11 |
|
---|
| 12 | project(PacpusSensors)
|
---|
| 13 | cmake_minimum_required(VERSION 2.8)
|
---|
| 14 |
|
---|
| 15 | # ========================================
|
---|
| 16 | # PacpusSensors version
|
---|
| 17 | # ========================================
|
---|
| 18 | set(PacpusSensors_MAJOR_VERSION 0)
|
---|
| 19 | set(PacpusSensors_MINOR_VERSION 1)
|
---|
| 20 | set(PacpusSensors_PATCH_VERSION 0)
|
---|
| 21 | set(PacpusSensors_VERSION
|
---|
| 22 | "${PacpusSensors_MAJOR_VERSION}.${PacpusSensors_MINOR_VERSION}.${PacpusSensors_PATCH_VERSION}")
|
---|
| 23 |
|
---|
| 24 | # ========================================
|
---|
| 25 | # CMake variables
|
---|
| 26 | # ========================================
|
---|
| 27 | #set(PacpusSensors_ROOT_DIR ${CMAKE_SOURCE_DIR})
|
---|
| 28 | #set(PacpusSensors_CMAKE_DIR ${PacpusSensors_ROOT_DIR}/cmake)
|
---|
| 29 | #set(PacpusSensors_DOC_DIR ${PacpusSensors_ROOT_DIR}/doc)
|
---|
| 30 | #set(PacpusSensors_INCLUDE_DIR ${PacpusSensors_ROOT_DIR}/include)
|
---|
[5] | 31 | set(PACPUS_INCLUDE_DIR ${PACPUS_ROOT_DIR}/include)
|
---|
[1] | 32 |
|
---|
| 33 | # ========================================
|
---|
| 34 | # Configure CMake
|
---|
| 35 | # ========================================
|
---|
[9] | 36 | if(NOT ${PACPUS_ROOT} STREQUAL "")
|
---|
[1] | 37 | set(CMAKE_MODULE_PATH ${PACPUS_ROOT}/cmake)
|
---|
| 38 | string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
---|
| 39 | message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
|
---|
| 40 | elseif( NOT $ENV{PACPUS_ROOT} STREQUAL "")
|
---|
[5] | 41 | set(PACPUS_ROOT $ENV{PACPUS_ROOT})
|
---|
[1] | 42 | set(CMAKE_MODULE_PATH $ENV{PACPUS_ROOT}/cmake)
|
---|
| 43 | string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
---|
| 44 | message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
|
---|
[5] | 45 | message (STATUS "PACPUS_ROOT is: " ${PACPUS_ROOT})
|
---|
[1] | 46 | else()
|
---|
| 47 | message (FATAL_ERROR "Environment variable PACPUS_ROOT not set, please define it in your operating system or pass it as argument to the cmake command")
|
---|
| 48 | endif()
|
---|
| 49 |
|
---|
[27] | 50 | include(${CMAKE_MODULE_PATH}/PacpusUtilities.cmake)
|
---|
| 51 | include(${CMAKE_MODULE_PATH}/PacpusConfiguration.cmake)
|
---|
| 52 | include(${CMAKE_MODULE_PATH}/PacpusDependencies.cmake)
|
---|
| 53 | include(${CMAKE_MODULE_PATH}/PacpusPlatforms.cmake)
|
---|
[1] | 54 |
|
---|
| 55 | # ========================================
|
---|
| 56 | # Pre-configuration of the compiler
|
---|
| 57 | # ========================================
|
---|
| 58 | find_package(Pacpus REQUIRED)
|
---|
| 59 | # Includes directories
|
---|
| 60 | if(PACPUS_FOUND)
|
---|
| 61 | include_directories(
|
---|
| 62 | ${PACPUS_DEPENDENCIES_INC}
|
---|
| 63 | ${PACPUS_INCLUDE_DIR}
|
---|
| 64 | )
|
---|
| 65 | # Compiler flags coming from PacpusDependencies and PacpusPlatforms
|
---|
| 66 | add_definitions(${PACPUS_DEFINITIONS})
|
---|
| 67 | endif(PACPUS_FOUND)
|
---|
| 68 |
|
---|
| 69 |
|
---|
| 70 | # ========================================
|
---|
| 71 | # Find dependencies
|
---|
| 72 | # ========================================
|
---|
| 73 | find_package(Qt4 REQUIRED)
|
---|
| 74 | if(QT4_FOUND)
|
---|
| 75 | set(QT_USE_QTNETWORK TRUE)
|
---|
| 76 | set(QT_USE_QTOPENGL TRUE)
|
---|
| 77 | set(QT_USE_QTXML TRUE)
|
---|
| 78 | include(${QT_USE_FILE})
|
---|
| 79 | add_definitions( ${QT_DEFINITIONS} )
|
---|
| 80 | add_definitions( -DQT_PLUGIN )
|
---|
| 81 | endif(QT4_FOUND)
|
---|
| 82 |
|
---|
[4] | 83 | include_directories(
|
---|
| 84 | ${PACPUS_DEPENDENCIES_INC}
|
---|
| 85 | ${PACPUS_INCLUDE_DIR}
|
---|
| 86 | ${PACPUS_INCLUDE_HINT}
|
---|
| 87 | ${PACPUS_INCLUDE_HINT}/Pacpus
|
---|
| 88 | ./PACPUS/include
|
---|
| 89 | )
|
---|
[1] | 90 |
|
---|
| 91 | # ========================================
|
---|
| 92 | # Build the PacpusSensors' modules
|
---|
| 93 | # ========================================
|
---|
[21] | 94 | #add_subdirectory(Alasca)
|
---|
| 95 | #add_subdirectory(CanGateway)
|
---|
| 96 | #add_subdirectory(LMOComponent)
|
---|
| 97 | #add_subdirectory(StdDbtPlayerComponents)
|
---|
| 98 | add_subdirectory(Dualshock)
|
---|
| 99 | add_subdirectory(Wifibot)
|
---|
| 100 | add_subdirectory(PacpusSocket)
|
---|
[1] | 101 |
|
---|
| 102 | # ========================================
|
---|
| 103 | # Summary
|
---|
| 104 | # ========================================
|
---|
| 105 | pacpus_info("")
|
---|
| 106 | pacpus_info("=====================================================================")
|
---|
| 107 | pacpus_info("Configuration for PacpusSensors ${PacpusSensors_VERSION}")
|
---|
| 108 | pacpus_info("=====================================================================")
|
---|
| 109 | pacpus_info("")
|
---|
| 110 | pacpus_info(" Platform:")
|
---|
| 111 | pacpus_info(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
---|
| 112 | if(CMAKE_CROSS_COMPILING)
|
---|
| 113 | pacpus_info(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
|
---|
| 114 | endif()
|
---|
| 115 | pacpus_info(" CMake:" ${CMAKE_VERSION})
|
---|
| 116 | pacpus_info(" CMake generator:" ${CMAKE_GENERATOR})
|
---|
| 117 | pacpus_info(" CMake build tool:" ${CMAKE_BUILD_TOOL})
|
---|
| 118 | if(MSVC)
|
---|
| 119 | pacpus_info(" MSVC:" ${MSVC_VERSION})
|
---|
| 120 | else()
|
---|
| 121 | pacpus_info(" Configuration:" ${CMAKE_BUILD_TYPE})
|
---|
| 122 | endif()
|
---|
| 123 | pacpus_info("")
|
---|
| 124 | pacpus_info(" Compiler:")
|
---|
| 125 | pacpus_info(" C++ Compiler:" ${CMAKE_CXX_COMPILER})
|
---|
| 126 | pacpus_info(" C++ flags (release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
|
---|
| 127 | pacpus_info(" C++ flags (debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
|
---|
| 128 | pacpus_info("")
|
---|
| 129 | pacpus_info(" Pacpus:")
|
---|
| 130 | pacpus_info(" PacpusFramework path:" ${PACPUS_ROOT})
|
---|
| 131 | pacpus_info(" Log4cxx logging enabled:" ${PACPUS_USE_LOG})
|
---|
| 132 | pacpus_info("")
|
---|
| 133 | if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
---|
| 134 | message(WARNING "The source directory is the same as build directory. \"make clean\" may damage the source tree")
|
---|
| 135 | endif()
|
---|