Skip to content

Commit

Permalink
revert cmakelists changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-khwarizmi-780 committed Apr 28, 2024
1 parent b462f7e commit 24f8072
Show file tree
Hide file tree
Showing 11 changed files with 308 additions and 324 deletions.
143 changes: 50 additions & 93 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,95 +1,52 @@
cmake_minimum_required(VERSION 3.4)

#== == == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == ==
#VCPKG Toolchain
#== == == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == ==
if (WIN32)
#use vcpkg as packages manager in windows platform
#environment variable needs to be added for the path to vcpkg installation \
"VCPKG_ROOT"
set(CMAKE_TOOLCHAIN_FILE
"$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake") endif(WIN32)

#== == == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == ==
#== == == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == ==
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) set(
CMAKE_INCLUDE_CURRENT_DIR
ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR} / build / package)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(BUILD_GMOCK OFF CACHE BOOL
"" FORCE) set(BUILD_GTEST ON CACHE BOOL "" FORCE)

project(OpenKF)

set(INCLUDE_FOLDER "include") set(
LIBRARY_INSTALL_DIR
"lib") set(INCLUDE_INSTALL_DIR "${INCLUDE_"
"FOLDER}/"
"${PROJECT_"
"NAME}") set(CONFIG_INSTALL_DIR
"${"
"LI"
"BR"
"AR"
"Y_"
"IN"
"ST"
"AL"
"L_"
"DI"
"R}"
"/c"
"ma"
"ke"
"/$"
"{P"
"RO"
"JE"
"CT"
"_N"
"AM"
"E"
"}")
set(namespace "%{PROJECT_NAME}::") set(
TARGETS_EXPORT_NAME
"${PROJECT_NAME}Targets")

enable_language(C CXX)

if (NOT MSVC) set(CMAKE_CXX_FLAGS "-O3 "
"-Wal"
"l "
"-Wex"
"tra") set(
CMAKE_CXX_FLAGS_DEBUG
"-g -Wall -Wextra") endif(NOT MSVC)

if (MSVC)
#https: // stackoverflow.com/a/18635749
add_compile_options(-MTd) endif(
MSVC)

find_package(
Eigen3 3.3 REQUIRED
NO_MODULE)

include(CTest)

add_subdirectory(
src /
third_party /
googletest)
add_subdirectory(
src /
openkf)
add_subdirectory(
src /
examples)
add_subdirectory(
tests)
# ============================================================================================
# VCPKG Toolchain
# ============================================================================================
if(WIN32)
# use vcpkg as packages manager in windows platform
# environment variable needs to be added for the path to vcpkg installation "VCPKG_ROOT"
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
endif(WIN32)

# ============================================================================================
# ============================================================================================
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/build/package)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
set(BUILD_GTEST ON CACHE BOOL "" FORCE)

project(OpenKF)

set(INCLUDE_FOLDER "include")
set(LIBRARY_INSTALL_DIR "lib")
set(INCLUDE_INSTALL_DIR "${INCLUDE_FOLDER}/${PROJECT_NAME}")
set(CONFIG_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/cmake/${PROJECT_NAME}")
set(namespace "%{PROJECT_NAME}::")
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")

enable_language(C CXX)

if (NOT MSVC)
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra")
endif(NOT MSVC)

if (MSVC)
# https://stackoverflow.com/a/18635749
add_compile_options(-MTd)
endif (MSVC)

find_package(Eigen3 3.3 REQUIRED NO_MODULE)

include(CTest)

add_subdirectory(src/third_party/googletest)
add_subdirectory(src/openkf)
add_subdirectory(src/examples)
add_subdirectory(tests)
12 changes: 7 additions & 5 deletions src/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
set(EXAMPLE_EXECUTABLE_PREFIX "example_")

add_subdirectory(kf_state_estimation) add_subdirectory(ekf_range_sensor)
add_subdirectory(unscented_transform) add_subdirectory(ukf_range_sensor)
add_subdirectory(test_least_squares)
add_subdirectory(sr_ukf_linear_function)
add_subdirectory(ego_motion_model_adapter)
add_subdirectory(kf_state_estimation)
add_subdirectory(ekf_range_sensor)
add_subdirectory(unscented_transform)
add_subdirectory(ukf_range_sensor)
add_subdirectory(test_least_squares)
add_subdirectory(sr_ukf_linear_function)
add_subdirectory(ego_motion_model_adapter)
45 changes: 25 additions & 20 deletions src/examples/ego_motion_model_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
####Copyright 2022 Mohanad Youssef(Al - khwarizmi)####Use of
this source code is governed by an GPL
- 3.0 - style##license that can be found in the LICENSE file
or at##https
: // opensource.org/licenses/GPL-3.0
####@author Mohanad Youssef<mohanad.magdy.hammad @gmail.com>##
@file CMakeLists.h##
##
## Copyright 2022 Mohanad Youssef (Al-khwarizmi)
##
## Use of this source code is governed by an GPL-3.0 - style
## license that can be found in the LICENSE file or at
## https://opensource.org/licenses/GPL-3.0
##
## @author Mohanad Youssef <mohanad.magdy.hammad@gmail.com>
## @file CMakeLists.h
##

file(GLOB PROJECT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
file(GLOB PROJECT_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)

set(APPLICATION_NAME ${
EXAMPLE_EXECUTABLE_PREFIX} _ego_motion_model_adapter)
set(APPLICATION_NAME ${EXAMPLE_EXECUTABLE_PREFIX}_ego_motion_model_adapter)

add_executable(${APPLICATION_NAME} ${PROJECT_FILES})
add_executable(${APPLICATION_NAME} ${PROJECT_FILES})

set_target_properties(${
APPLICATION_NAME} PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(${APPLICATION_NAME} PROPERTIES LINKER_LANGUAGE CXX)

target_link_libraries(${
APPLICATION_NAME} PUBLIC Eigen3::Eigen OpenKF)
target_link_libraries(${APPLICATION_NAME}
PUBLIC
Eigen3::Eigen
OpenKF
)

target_include_directories(
${APPLICATION_NAME} PUBLIC $<
BUILD_INTERFACE : ${CMAKE_CURRENT_SOURCE_DIR} /
../../>)
target_include_directories(${APPLICATION_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../>
)
44 changes: 25 additions & 19 deletions src/examples/ekf_range_sensor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
####Copyright 2022 Mohanad Youssef(Al - khwarizmi)####Use of
this source code is governed by an GPL
- 3.0 - style##license that can be found in the LICENSE file
or at##https
: // opensource.org/licenses/GPL-3.0
####@author Mohanad Youssef<mohanad.magdy.hammad @gmail.com>##
@file CMakeLists.h##
##
## Copyright 2022 Mohanad Youssef (Al-khwarizmi)
##
## Use of this source code is governed by an GPL-3.0 - style
## license that can be found in the LICENSE file or at
## https://opensource.org/licenses/GPL-3.0
##
## @author Mohanad Youssef <mohanad.magdy.hammad@gmail.com>
## @file CMakeLists.h
##

file(GLOB PROJECT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
file(GLOB PROJECT_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)

set(APPLICATION_NAME ${EXAMPLE_EXECUTABLE_PREFIX} _ekf_range_sensor)
set(APPLICATION_NAME ${EXAMPLE_EXECUTABLE_PREFIX}_ekf_range_sensor)

add_executable(${APPLICATION_NAME} ${PROJECT_FILES})
add_executable(${APPLICATION_NAME} ${PROJECT_FILES})

set_target_properties(${
APPLICATION_NAME} PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(${APPLICATION_NAME} PROPERTIES LINKER_LANGUAGE CXX)

target_link_libraries(${
APPLICATION_NAME} PUBLIC Eigen3::Eigen OpenKF)
target_link_libraries(${APPLICATION_NAME}
PUBLIC
Eigen3::Eigen
OpenKF
)

target_include_directories(
${APPLICATION_NAME} PUBLIC $<
BUILD_INTERFACE : ${CMAKE_CURRENT_SOURCE_DIR} /
../../>)
target_include_directories(${APPLICATION_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../>
)
45 changes: 25 additions & 20 deletions src/examples/kf_state_estimation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
####Copyright 2022 Mohanad Youssef(Al - khwarizmi)####Use of
this source code is governed by an GPL
- 3.0 - style##license that can be found in the LICENSE file
or at##https
: // opensource.org/licenses/GPL-3.0
####@author Mohanad Youssef<mohanad.magdy.hammad @gmail.com>##
@file CMakeLists.h##
##
## Copyright 2022 Mohanad Youssef (Al-khwarizmi)
##
## Use of this source code is governed by an GPL-3.0 - style
## license that can be found in the LICENSE file or at
## https://opensource.org/licenses/GPL-3.0
##
## @author Mohanad Youssef <mohanad.magdy.hammad@gmail.com>
## @file CMakeLists.h
##

file(GLOB PROJECT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
file(GLOB PROJECT_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)

set(APPLICATION_NAME ${
EXAMPLE_EXECUTABLE_PREFIX} _kf_state_estimation)
set(APPLICATION_NAME ${EXAMPLE_EXECUTABLE_PREFIX}_kf_state_estimation)

add_executable(${APPLICATION_NAME} ${PROJECT_FILES})
add_executable(${APPLICATION_NAME} ${PROJECT_FILES})

set_target_properties(${
APPLICATION_NAME} PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(${APPLICATION_NAME} PROPERTIES LINKER_LANGUAGE CXX)

target_link_libraries(${
APPLICATION_NAME} PUBLIC Eigen3::Eigen OpenKF)
target_link_libraries(${APPLICATION_NAME}
PUBLIC
Eigen3::Eigen
OpenKF
)

target_include_directories(
${APPLICATION_NAME} PUBLIC $<
BUILD_INTERFACE : ${CMAKE_CURRENT_SOURCE_DIR} /
../../>)
target_include_directories(${APPLICATION_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../>
)
45 changes: 25 additions & 20 deletions src/examples/sr_ukf_linear_function/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
####Copyright 2022 Mohanad Youssef(Al - khwarizmi)####Use of
this source code is governed by an GPL
- 3.0 - style##license that can be found in the LICENSE file
or at##https
: // opensource.org/licenses/GPL-3.0
####@author Mohanad Youssef<mohanad.magdy.hammad @gmail.com>##
@file CMakeLists.h##
##
## Copyright 2022 Mohanad Youssef (Al-khwarizmi)
##
## Use of this source code is governed by an GPL-3.0 - style
## license that can be found in the LICENSE file or at
## https://opensource.org/licenses/GPL-3.0
##
## @author Mohanad Youssef <mohanad.magdy.hammad@gmail.com>
## @file CMakeLists.h
##

file(GLOB PROJECT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
file(GLOB PROJECT_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)

set(APPLICATION_NAME ${
EXAMPLE_EXECUTABLE_PREFIX} _sr_ukf_linear_function)
set(APPLICATION_NAME ${EXAMPLE_EXECUTABLE_PREFIX}_sr_ukf_linear_function)

add_executable(${APPLICATION_NAME} ${PROJECT_FILES})
add_executable(${APPLICATION_NAME} ${PROJECT_FILES})

set_target_properties(${
APPLICATION_NAME} PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(${APPLICATION_NAME} PROPERTIES LINKER_LANGUAGE CXX)

target_link_libraries(${
APPLICATION_NAME} PUBLIC Eigen3::Eigen OpenKF)
target_link_libraries(${APPLICATION_NAME}
PUBLIC
Eigen3::Eigen
OpenKF
)

target_include_directories(
${APPLICATION_NAME} PUBLIC $<
BUILD_INTERFACE : ${CMAKE_CURRENT_SOURCE_DIR} /
../../>)
target_include_directories(${APPLICATION_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../>
)
Loading

0 comments on commit 24f8072

Please sign in to comment.