-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Claire
committed
May 11, 2023
1 parent
f014ff1
commit d5f1930
Showing
2 changed files
with
38 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
# don't update VERSION here, its in the farm_ng_cmakeConfigVersion.cmake file | ||
project(farm_ng_cmake) | ||
# https://semver.org/ | ||
project(farm_ng_all VERSION 0.0.1) | ||
|
||
# NOTE assumes that cmake is a flat directory | ||
file(GLOB FARM_NG_CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/*") | ||
|
||
install(FILES | ||
${FARM_NG_CMAKE_FILES} | ||
DESTINATION | ||
share/farm_ng_cmake/cmake | ||
if(NOT "$ENV{VIRTUAL_ENV}/prefix" STREQUAL "$ENV{CMAKE_PREFIX_PATH}") | ||
message(FATAL_ERROR "CMAKE_PREFIX_PATH does not match current VIRTUAL_ENV path.\n" | ||
"ENV{CMAKE_PREFIX_PATH}: '$ENV{CMAKE_PREFIX_PATH}'\n" | ||
"ENV{VIRTUAL_ENV}/prefix: '$ENV{VIRTUAL_ENV}/prefix'\n" | ||
"Did you forget to activate your virtual environment before running cmake?\n" | ||
"# If your venv doesn't exist yet, run:\n" | ||
"> ${CMAKE_CURRENT_SOURCE_DIR}/bootstrap_venv.sh\n" | ||
"# To active your existing VENV, run:\n" | ||
"> source ${CMAKE_CURRENT_SOURCE_DIR}/venv/bin/activate\n" | ||
"# If using an IDE, launch it from the terminal after activating.\n" | ||
) | ||
|
||
|
||
option(FARM_NG_DEV_BUILD Off) | ||
if(NOT FARM_NG_DEV_BUILD) | ||
message(STATUS "To build farm-ng's development libraries:\n" | ||
"cmake -DFARM_NG_DEV_BUILD=ON .") | ||
return() | ||
endif() | ||
|
||
list(APPEND CMAKE_MODULE_PATH | ||
${CMAKE_CURRENT_LIST_DIR}/cmake) | ||
# here we build a c++ development environment | ||
include(ExternalProject) | ||
include(farm_ng_default_args) | ||
set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH} CACHE STRING "" FORCE) | ||
option(BUILD_FOR_AMIGA "Build only Amiga related components" OFF) | ||
if(BUILD_FOR_AMIGA) | ||
message(STATUS "Building subset of project for Amiga platform") | ||
set(FARM_NG_BUILD_TESTS=OFF) | ||
endif() | ||
|
||
include(External_fmt) | ||
include(External_expected) | ||
include(External_eigen) | ||
include(External_ceres) | ||
include(External_apriltag) | ||
include(External_cli11) | ||
include(External_boost) | ||
include(External_grpc) | ||
include(External_nlohmann_json) | ||
|
||
set(farm_ng_cmake_DIR ${CMAKE_CURRENT_SOURCE_DIR}/farm_ng_cmake/cmake) | ||
set(Pangolin_DIR ${CMAKE_CURRENT_BINARY_DIR}/Pangolin) | ||
find_package(farm_ng_cmake REQUIRED) | ||
add_subdirectory(farm_ng_core) | ||
add_subdirectory(Sophus) | ||
add_subdirectory(Pangolin) | ||
add_subdirectory(farm_ng_amiga) | ||
add_subdirectory(farm_ng_lk) | ||
if(NOT BUILD_FOR_AMIGA) | ||
add_subdirectory(farm_ng_spice) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ExternalProject_Add(libdatachannel | ||
GIT_REPOSITORY "https://github.com/paullouisageneau/libdatachannel" | ||
GIT_TAG "v0.18.3" | ||
GIT_SHALLOW ON | ||
PREFIX ${farm_ng_EXT_PREFIX} | ||
CMAKE_ARGS | ||
${farm_ng_DEFAULT_ARGS} | ||
-DCMAKE_BUILD_TYPE=Release | ||
) |