Brian Silverman | f7f267a | 2017-02-04 16:16:08 -0800 | [diff] [blame^] | 1 | cmake_minimum_required(VERSION 2.8) |
| 2 | project(AllC++Sim) |
| 3 | |
| 4 | include(CheckCXXCompilerFlag) |
| 5 | include (FindPkgConfig) |
| 6 | include(GNUInstallDirs) |
| 7 | |
| 8 | #check for depenedencies |
| 9 | find_package(gazebo REQUIRED) |
| 10 | find_package(Boost COMPONENTS system filesystem REQUIRED) |
| 11 | |
| 12 | #on windows we produce .dlls with no prefix |
| 13 | if(WIN32) |
| 14 | #allows us to define constexpr and noexcept in macros |
| 15 | #since msvc 2013 doesn't support them |
| 16 | add_definitions(-D_ALLOW_KEYWORD_MACROS) |
| 17 | |
| 18 | # defines things like M_PI |
| 19 | add_definitions(-D_USE_MATH_DEFINES) |
| 20 | |
| 21 | # get rid of min max macros on windows |
| 22 | add_definitions(-DNOMINMAX) |
| 23 | |
| 24 | add_definitions(-DWIN32_LEAN_AND_MEAN) |
| 25 | |
| 26 | SET(CMAKE_FIND_LIBRARY_PREFIXES "") |
| 27 | SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll") |
| 28 | endif() |
| 29 | |
| 30 | if (MSVC) |
| 31 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFRC_SIMULATOR /MDd /Zi") |
| 32 | else () |
| 33 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++1y -DFRC_SIMULATOR -Wno-unused-parameter -pthread -fPIC -fpermissive") |
| 34 | endif() |
| 35 | |
| 36 | include_directories("build") |
| 37 | add_subdirectory(simulation/gz_msgs) |
| 38 | add_subdirectory(wpilibc/sim) |
| 39 | add_subdirectory(simulation/frc_gazebo_plugins) |