|
1 | | -cmake_minimum_required(VERSION 3.14) |
| 1 | +cmake_minimum_required(VERSION 3.22) |
2 | 2 | project(hydra VERSION 2.0.0) |
3 | 3 |
|
4 | 4 | set(CMAKE_CXX_STANDARD 17) |
5 | 5 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
6 | 6 | set(CMAKE_CXX_EXTENSIONS OFF) |
7 | | -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") |
8 | 7 |
|
9 | | -add_compile_options(-Wall -Wextra) |
| 8 | +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
| 9 | + add_compile_options(-Wall -Wextra -Wpedantic) |
| 10 | +endif() |
| 11 | + |
| 12 | +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) |
| 13 | + # from: https://www.kitware.com//cmake-and-the-default-build-type/ |
| 14 | + message(STATUS "Setting build type to 'Release' as none was specified.") |
| 15 | + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE) |
| 16 | +endif() |
| 17 | + |
| 18 | +if(NOT CMAKE_INTERPROCEDURAL_OPTIMIZATION) |
| 19 | + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON CACHE STRING "Turn on -flto" FORCE) |
| 20 | +endif() |
10 | 21 |
|
| 22 | +option(BUILD_SHARED_LIBS "Build shared libs" ON) |
11 | 23 | option(HYDRA_ENABLE_EVAL "Build evaluation code" ON) |
12 | 24 | option(HYDRA_ENABLE_GNN "Build GNN interface" OFF) |
13 | 25 | option(HYDRA_ENABLE_PYTHON "Build Hydra python bindings" OFF) |
14 | 26 | option(HYDRA_ENABLE_ROS_INSTALL_LAYOUT "Install binaries to ROS location" ON) |
15 | | -option(BUILD_SHARED_LIBS "Build shared libs" ON) |
| 27 | + |
| 28 | +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") |
16 | 29 |
|
17 | 30 | find_package(config_utilities REQUIRED) |
18 | 31 | find_package(Eigen3 REQUIRED) |
|
0 commit comments