-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.CommonFlag.cmake
34 lines (30 loc) · 1.04 KB
/
CMakeLists.CommonFlag.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
SET(WINDOWS 0)
SET(LINUX 0)
MESSAGE(STATUS "Current platform ${CMAKE_SYSTEM_NAME}")
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(LINUX 1)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
SET(WINDOWS 1)
ELSE (CMAKE_SYSTEM_NAME MATCHES "Linux")
MESSAGE(FATAL_ERROR "Not support platform ${CMAKE_SYSTEM_NAME}")
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
IF (LINUX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -pthread")
SET(BOOST_ROOT "/home/boost")
FIND_PACKAGE(Boost)
IF (NOT Boost_FOUND)
MESSAGE(FATAL_ERROR "Cannot find boost")
ELSE (NOT Boost_FOUND)
MESSAGE(STATUS "Boost include dir is ${Boost_INCLUDE_DIRS}")
MESSAGE(STATUS "Boost library dir is ${Boost_LIBRARY_DIRS}")
MESSAGE(STATUS "Boost version is ${Boost_VERSION}")
ENDIF (NOT Boost_FOUND)
ENDIF (LINUX)
IF (WINDOWS)
FILE(GLOB_RECURSE common_files src/common/*)
SOURCE_GROUP(common FILES ${common_files})
FILE(GLOB_RECURSE rtsp_files src/rtsp/*)
SOURCE_GROUP(rtsp FILES ${rtsp_files})
FILE(GLOB_RECURSE main_file src/main.cc)
SOURCE_GROUP(main FILES ${main_file})
ENDIF (WINDOWS)