12345678910111213141516171819202122232425262728293031323334353637 |
- cmake_minimum_required(VERSION 3.0.0)
- project(update_time VERSION 0.1.0 LANGUAGES C CXX)
- MESSAGE(STATUS "operation system is ${CMAKE_HOST_SYSTEM_PROCESSOR}")
-
- IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64")
- SET (CMAKE_C_COMPILER "/usr/bin/clang")
- SET (CMAKE_CXX_COMPILER "/usr/bin/clang++")
- SET (CMAKE_AR "/usr/bin/llvm-ar")
- SET (CMAKE_LINKER "/usr/bin/llvm-link")
- SET (CMAKE_NM "/usr/bin/llvm-nm")
- SET (CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
- ENDIF()
- if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g2 -ggdb -Wall -Wno-unused-variable -pthread")
- endif()
- find_package(Protobuf REQUIRED)
- include_directories(${Protobuf_INCLUDE_DIRS})
- add_definitions(-DJSONCPP_USING_SECURE_MEMORY=0)
- add_definitions(-DWEBRTC_POSIX=1)
- add_definitions(-DWEBRTC_LINUX=1)
- file(GLOB native_srcs "*.cpp")
- set(CURDIR ${CMAKE_CURRENT_LIST_DIR})
- file(GLOB common_srcs ${CURDIR}/../common/socketclient.cpp ${CURDIR}/../common/iobuffer.cpp)
- IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
- include_directories("../thirdparty/protobuf/include")
- ELSE()
- find_package(Protobuf REQUIRED)
- include_directories(${Protobuf_INCLUDE_DIRS})
- include_directories("../thirdparty/Eigen/eigen3")
- ENDIF()
- include_directories(${CURDIR}/../protocol/linux/)
- file(GLOB proto_srcs ${CURDIR}/../protocol/linux/*.cc)
-
- file(GLOB native_srcs "*.cpp")
- add_executable(update_time ${native_srcs} ${common_srcs} ${proto_srcs})
- target_link_libraries(update_time ${Protobuf_LIBRARIES})
-
|