-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #351 from fawkesrobotics/common/cmake
switch to cmake as buildsys
- Loading branch information
Showing
882 changed files
with
7,511 additions
and
319 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
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
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
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
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,52 @@ | ||
# ***************************************************************************** | ||
# CMake Build System for Fawkes | ||
# ------------------- | ||
# Copyright (C) 2023 by Tarik Viehmann and Daniel Swoboda | ||
# | ||
# ***************************************************************************** | ||
# | ||
# This program is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License as published by the Free Software | ||
# Foundation, either version 3 of the License, or (at your option) any later | ||
# version. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# ***************************************************************************** | ||
|
||
if(NOT FAWKES_DIR) | ||
cmake_minimum_required(VERSION 3.5) | ||
project(fawkes) | ||
set(_FAWKES_DEPENDENCIES_CHECKED | ||
"" | ||
CACHE INTERNAL "") | ||
# make local cmake modules available | ||
set(FAWKES_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${FAWKES_CORE_DIR}/cmake") | ||
include(base) | ||
endif() | ||
|
||
add_subdirectory(src) | ||
if(NOT FAWKES_DIR) | ||
set_common_properties_of_targets(all_targets) | ||
endif() | ||
# add_subdirectory(src/libs) add_subdirectory(src/plugins) | ||
# add_subdirectory(src/mainapp) add_subdirectory(src/tools) | ||
# if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
# add_compile_options(-Wall -Wextra -Wpedantic) endif() | ||
# | ||
# collect the files for subdir1 include(src/libs//CMakeLists.txt) foreach(FILE | ||
# ${FILES}) set(subdir1Files ${subdir1Files} subdir1/${FILE}) endforeach() | ||
# | ||
# collect the files for subdir2 include(subdir2/CMakeLists.txt) foreach(FILE | ||
# ${FILES}) set(subdir2Files ${subdir2Files} subdir2/${FILE}) endforeach() | ||
# | ||
# add the source files to the executable add_executable(fawkes) | ||
# | ||
# ${subdir1Files} ${subdir2Files |
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
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,89 @@ | ||
# ***************************************************************************** | ||
# CMake Build System for Fawkes | ||
# ------------------- | ||
# Copyright (C) 2023 by Tarik Viehmann and Daniel Swoboda | ||
# | ||
# ***************************************************************************** | ||
# | ||
# This program is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License as published by the Free Software | ||
# Foundation, either version 3 of the License, or (at your option) any later | ||
# version. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# ***************************************************************************** | ||
|
||
include(GNUInstallDirs) | ||
find_package(PkgConfig REQUIRED) | ||
|
||
# make local cmake modules available | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${FAWKES_CORE_DIR}/cmake") | ||
set(CMAKE_BUILD_TYPE "Debug") | ||
|
||
# TODO: .ts generation of rest-api plugins (see old Makefiles in rest-api dirs) | ||
# This is not urgent, as the generated stuff is already in git this was handled | ||
# through rest-api.mk add_custom_target(restapi-generate echo | ||
# "generate-restapi") set(WEBVIEW_FRONTEND_SRCDIR | ||
# ${PROJECT_SOURCE_DIR}/src/plugins/webview/frontend/src) | ||
|
||
set(FAWKES_PLUGIN_DIR ${PROJECT_SOURCE_DIR}/plugins/) | ||
set(FAWKES_LIB_DIR ${PROJECT_SOURCE_DIR}/lib) | ||
set(FAWKES_RES_DIR ${FAWKES_CORE_DIR}/res) | ||
set(FAWKES_LUA_LIB_DIR ${FAWKES_LIB_DIR}/lua) | ||
set(FAWKES_INTERFACE_DIR ${FAWKES_LIB_DIR}/interfaces/) | ||
set(FAWKES_LUA_INTERFACE_DIR ${FAWKES_LUA_LIB_DIR}/interfaces/) | ||
set(FAWKES_EXECUTABLE_DIR ${PROJECT_SOURCE_DIR}/bin) | ||
file(MAKE_DIRECTORY ${FAWKES_PLUGIN_DIR}) | ||
file(MAKE_DIRECTORY ${FAWKES_RES_DIR}) | ||
file(MAKE_DIRECTORY ${FAWKES_LIB_DIR}) | ||
|
||
file(MAKE_DIRECTORY ${FAWKES_LUA_LIB_DIR}) | ||
file(MAKE_DIRECTORY ${FAWKES_LUA_INTERFACE_DIR}) | ||
file(MAKE_DIRECTORY ${FAWKES_EXECUTABLE_DIR}) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${FAWKES_EXECUTABLE_DIR}) | ||
include_directories(${FAWKES_LIB_DIR}) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${FAWKES_LIB_DIR}) | ||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
message( | ||
STATUS | ||
"Setting build type to '${default_build_type}' as none was specified.") | ||
set(CMAKE_BUILD_TYPE | ||
"${default_build_type}" | ||
CACHE STRING "Choose the type of build." FORCE) | ||
# Set the possible values of build type for cmake-gui | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" | ||
"MinSizeRel" "RelWithDebInfo") | ||
|
||
endif() | ||
|
||
set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE TRUE) | ||
include(utils) | ||
include(dependencies) | ||
include(libcrypto) | ||
include(libxmlpp) | ||
include(laser) | ||
include(ros) | ||
include(lua) | ||
include(yamlcpp) | ||
include(eigen3) | ||
include(pcl) | ||
include(tf) | ||
include(gui) | ||
include(navgraph) | ||
include(cgal_libs) | ||
include(webview) | ||
include(fvconf) | ||
include(kdl_parser) | ||
include(clipsmm) | ||
include(protobuf) | ||
include(robot_memory) | ||
include(doxygen) | ||
include(tests) | ||
include(integration_test) |
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,44 @@ | ||
# ***************************************************************************** | ||
# CMake Build System for Fawkes | ||
# ------------------- | ||
# Copyright (C) 2023 by Tarik Viehmann and Daniel Swoboda | ||
# | ||
# ***************************************************************************** | ||
# | ||
# This program is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License as published by the Free Software | ||
# Foundation, either version 3 of the License, or (at your option) any later | ||
# version. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# ***************************************************************************** | ||
|
||
function(depend_on_cgal_libs target) | ||
if(NOT CGAL IN_LIST _FAWKES_DEPENDENCIES_CHECKED) | ||
find_package(CGAL) | ||
remember_dependency(CGAL) | ||
endif() | ||
|
||
depend_on_pkgconfig_libs(${target} "gmp;mpfr") | ||
depend_on_boost_libs(${target} "system;thread") | ||
target_include_directories(${target} PUBLIC ${Boost_INCLUDE_DIR}) | ||
target_link_libraries(${target} ${CGAL_LDLAGS} ${GMP_LDFLAGS} ${MPFR_LDFLAGS} | ||
-lm) | ||
target_compile_options( | ||
${target} | ||
PUBLIC ${CGAL_LDLAGS} | ||
${GMP_LDFLAGS} | ||
${MPFR_LDFLAGS} | ||
-DHAVE_CGAL | ||
-Wno-depcrecated-register | ||
-DCGAL_DISABLE_ROUNDING_MATH_CHECK | ||
-frounding-math) | ||
# TODO: clang flags: -Wno-unused-local-typedef | ||
endfunction() |
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,28 @@ | ||
# ***************************************************************************** | ||
# CMake Build System for Fawkes | ||
# ------------------- | ||
# Copyright (C) 2023 by Tarik Viehmann and Daniel Swoboda | ||
# | ||
# ***************************************************************************** | ||
# | ||
# This program is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License as published by the Free Software | ||
# Foundation, either version 3 of the License, or (at your option) any later | ||
# version. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# ***************************************************************************** | ||
|
||
function(depend_on_clipsmm target) | ||
depend_on_pkgconfig_libs(${target} clipsmm-1.0) | ||
target_compile_options(${target} PUBLIC -DHAVE_CLIPS ${CLIPSMM_CFLAGS}) | ||
target_link_libraries(${target} ${CLIPSMM_LDFLAGS}) | ||
target_compile_features(${target} PUBLIC cxx_std_14) | ||
endfunction() |
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,66 @@ | ||
# ***************************************************************************** | ||
# CMake Build System for Fawkes | ||
# ------------------- | ||
# Copyright (C) 2023 by Tarik Viehmann and Daniel Swoboda | ||
# | ||
# ***************************************************************************** | ||
# | ||
# This program is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License as published by the Free Software | ||
# Foundation, either version 3 of the License, or (at your option) any later | ||
# version. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# ***************************************************************************** | ||
|
||
pkg_check_modules(yaml-cpp REQUIRED yaml-cpp>=0.5.3) | ||
remember_dependency(yaml-cpp) | ||
|
||
pkg_check_modules(libelf REQUIRED libelf) | ||
remember_dependency(libelf) | ||
|
||
find_package(Boost COMPONENTS system thread filesystem) | ||
if(Boost_SYSTEM_FOUND AND Boost_THREAD_FOUND) | ||
set(SICK_TIM55X_BOOST_DEPS_FOUND | ||
1 | ||
CACHE BOOL "SICK_TIM55x boost dependencies") | ||
add_library(sick_tim55x INTERFACE IMPORTED) | ||
target_include_directories(sick_tim55x INTERFACE ${Boost_INCLUDE_DIRS}) | ||
target_link_libraries(sick_tim55x INTERFACE -lpthread ${Boost_LIBRARIES}) | ||
target_compile_definitions(sick_tim55x INTERFACE HAVE_SICK55X_BOOST) | ||
# target_compile_definitions do not work with imported targets | ||
endif() | ||
|
||
find_path(URG_ROOT urg/UrgCtrl.h PATH_SUFFIXES include) | ||
if(URG_ROOT) | ||
add_library(liburg INTERFACE IMPORTED) | ||
target_include_directories(liburg INTERFACE ${URG_ROOT}) | ||
target_link_directories(liburg INTERFACE ${URG_ROOT}/lib) | ||
target_link_libraries( | ||
liburg | ||
INTERFACE urg | ||
urg_connection | ||
urg_monitor | ||
urg_coordinate | ||
urg_geometry | ||
urg_system | ||
urg_common | ||
urg_connection_sdl) | ||
set(URG_C_DEFINITION HAVE_URG) | ||
endif() | ||
|
||
find_path(FLITE_ROOT flite/flite.h PATH_SUFFIXES include) | ||
if(FLITE_ROOT) | ||
add_library(FLite INTERFACE IMPORTED) | ||
target_include_directories(FLite INTERFACE ${FLITE_ROOT}) | ||
target_link_directories(FLite INTERFACE ${FLITE_ROOT}/lib) | ||
target_link_libraries(FLite INTERFACE -lflite_cmu_us_kal -lflite_usenglish | ||
-lflite_cmulex -lflite -lm) | ||
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,8 @@ | ||
find_package(Doxygen) | ||
set(DOXYGEN_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/doc/api/) | ||
set(DOXYGEN_WARN_LOGFILE doxywarnings.txt) | ||
set(DOXYGEN_HAVE_DOT NO) | ||
set(DOXYGEN_EXCLUDE_PATTERNS | ||
"${FAWKES_CORE_DIR}/src/plugins/webview/frontend;**/*.pb.*;\ | ||
**/*Interface.*;**/*.py;**/attic/*;") | ||
doxygen_add_docs(doxygen ${PROJECT_SOURCE_DIR} COMMENT "Generate man pages") |
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,37 @@ | ||
# ***************************************************************************** | ||
# CMake Build System for Fawkes | ||
# ------------------- | ||
# Copyright (C) 2023 by Tarik Viehmann and Daniel Swoboda | ||
# | ||
# ***************************************************************************** | ||
# | ||
# This program is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License as published by the Free Software | ||
# Foundation, either version 3 of the License, or (at your option) any later | ||
# version. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# ***************************************************************************** | ||
|
||
set(EIGEN3_DEPS "eigen3") | ||
|
||
function(depend_on_eigen3 target) | ||
depend_on_pkgconfig_libs(${target} eigen3) | ||
target_compile_options( | ||
${target} PUBLIC -DHAVE_EIGEN3 -DEIGEN_USE_NEW_STDVECTOR | ||
-DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET) | ||
target_link_libraries(${target} tolua++) | ||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||
target_compile_options(${target} PRIVATE -Wno-deprecated-register) | ||
endif() | ||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
target_compile_options(${target} PRIVATE -Wno-deprecated-declarations) | ||
endif() | ||
endfunction() |
Oops, something went wrong.