86 lines
1.1 KiB
CMake
Executable File
86 lines
1.1 KiB
CMake
Executable File
# Usage:
|
|
# Create build folder, like RC-build next to RobotControl and WifiScan folder
|
|
# CD into build folder and execute 'cmake -DCMAKE_BUILD_TYPE=Debug ../RobotControl'
|
|
# make
|
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
|
|
|
# select build type
|
|
SET( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" )
|
|
|
|
PROJECT(Other2017)
|
|
|
|
IF(NOT CMAKE_BUILD_TYPE)
|
|
MESSAGE(STATUS "No build type selected. Default to Debug")
|
|
SET(CMAKE_BUILD_TYPE "Debug")
|
|
ENDIF()
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
../
|
|
)
|
|
|
|
|
|
FILE(GLOB HEADERS
|
|
./*.h
|
|
./*/*.h
|
|
./*/*/*.h
|
|
./*/*/*/*.h
|
|
./*/*/*/*/*.h
|
|
./*/*/*/*/*/*.h
|
|
./tests/data/*
|
|
./tests/data/*/*
|
|
./tests/data/*/*/*
|
|
)
|
|
|
|
|
|
FILE(GLOB SOURCES
|
|
./*.cpp
|
|
./*/*.cpp
|
|
./*/*/*.cpp
|
|
./*/*/*/*.cpp
|
|
../KLib/inc/tinyxml/tinyxml2.cpp
|
|
)
|
|
|
|
|
|
|
|
# system specific compiler flags
|
|
ADD_DEFINITIONS(
|
|
|
|
-std=gnu++11
|
|
|
|
-Wall
|
|
-Werror=return-type
|
|
-Wextra
|
|
-Wpedantic
|
|
|
|
-fstack-protector-all
|
|
|
|
-g3
|
|
-O0
|
|
-march=native
|
|
|
|
-DWITH_TESTS
|
|
-DWITH_ASSERTIONS
|
|
-DWITH_DEBUG_LOG
|
|
|
|
|
|
)
|
|
|
|
|
|
# build a binary file
|
|
ADD_EXECUTABLE(
|
|
${PROJECT_NAME}
|
|
${HEADERS}
|
|
${SOURCES}
|
|
)
|
|
|
|
# needed external libraries
|
|
TARGET_LINK_LIBRARIES(
|
|
${PROJECT_NAME}
|
|
gtest
|
|
pthread
|
|
)
|
|
|