Initial project version
This commit is contained in:
114
code/CMakeLists.txt
Normal file
114
code/CMakeLists.txt
Normal file
@@ -0,0 +1,114 @@
|
||||
# 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(ProLogic)
|
||||
|
||||
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
|
||||
filter.h
|
||||
mesh.h
|
||||
meshPlotter.h
|
||||
Plotti.h
|
||||
Plotty.h
|
||||
Settings.h
|
||||
FtmKalman.h
|
||||
main.h
|
||||
mainFtm.h
|
||||
)
|
||||
|
||||
|
||||
FILE(GLOB SOURCES
|
||||
../../Indoor/lib/tinyxml/tinyxml2.cpp
|
||||
../../Indoor/lib/Recast/*.cpp
|
||||
main.cpp
|
||||
mainFtm.cpp
|
||||
)
|
||||
|
||||
|
||||
if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||
add_definitions(
|
||||
-D_USE_MATH_DEFINES
|
||||
-DUNICODE
|
||||
-D_UNICODE
|
||||
-DNOGDI
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
|
||||
else()
|
||||
# system specific compiler flags
|
||||
ADD_DEFINITIONS(
|
||||
|
||||
#-std=gnu++14
|
||||
|
||||
-lstdc++fs
|
||||
|
||||
-Wall
|
||||
-Werror=return-type
|
||||
-Wextra
|
||||
-Wpedantic
|
||||
|
||||
-fstack-protector-all
|
||||
|
||||
-g3
|
||||
#-O2
|
||||
-march=native
|
||||
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
# -DWITH_TESTS
|
||||
-DWITH_ASSERTIONS
|
||||
-DWITH_DEBUG_LOG
|
||||
# -DWITH_DEBUG_PLOT
|
||||
# -D_GLIBCXX_DEBUG
|
||||
)
|
||||
|
||||
# allow OMP
|
||||
find_package(OpenMP)
|
||||
if (OPENMP_FOUND)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
|
||||
# build a binary file
|
||||
ADD_EXECUTABLE(
|
||||
${PROJECT_NAME}
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
# needed external libraries
|
||||
TARGET_LINK_LIBRARIES(
|
||||
${PROJECT_NAME}
|
||||
# stdc++fs
|
||||
# gtest
|
||||
# pthread
|
||||
)
|
||||
|
||||
SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
|
||||
Reference in New Issue
Block a user