Skip to content

Commit

Permalink
New Updates.
Browse files Browse the repository at this point in the history
- Updated all default packages to latest version as well.
- Added dynamic variable to set force to update packages to latest master or dev branch.
- Added OpenCV as default package.
- Added some examples.
- Fixed some issues.
  • Loading branch information
TheCompez committed Apr 25, 2023
1 parent 11df1d7 commit 854c7d6
Show file tree
Hide file tree
Showing 22 changed files with 396 additions and 96 deletions.
2 changes: 2 additions & 0 deletions .idea/Project-Template.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ endif()

find_package(Boost REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(OpenMesh REQUIRED)
find_package(GTest REQUIRED)
find_package(DocTest REQUIRED)
Expand Down
27 changes: 18 additions & 9 deletions cmake/packages/FindBoost.cmake
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
#Package Info.
# Package Info.
set(BOOST_NAME "Boost")
set(BOOST_DESCRIPTION "The Boost project provides free peer-reviewed portable C++ source libraries.")

#Pakcage option.
# Pakcage option.
option(USE_BOOST ${BOOST_DESCRIPTION} FALSE)
if (USE_BOOST)
add_definitions(-DUSE_BOOST)
# Define the repository URL and tag for the Boost libraries
set(BOOST_URL "https://github.com/boostorg/boost.git")
if(FORCE_UPGRADED_LIBS)
set(BOOST_TAG "master")
else()
set(BOOST_TAG "boost-1.82.0")
endif()
set(BOOST_LIB_LIST "Boost::system;Boost::chrono;Boost::filesystem;Boost::json" CACHE STRING "List of modules (separated by a semicolon)")
endif()

find_package(PkgConfig QUIET)
pkg_search_module(Boost boost)
#Package data repository.
# Package data repository.
if(USE_BOOST)
set(FETCHCONTENT_QUIET off)
get_filename_component(boost_base "${CMAKE_CURRENT_SOURCE_DIR}/${THIRD_PARTY}/${BOOST_NAME}"
REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
set(FETCHCONTENT_BASE_DIR ${boost_base})
# Declare the Boost libraries with their submodules using FetchContent_Declare
FetchContent_Declare(
Boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG master
boost
GIT_REPOSITORY ${BOOST_URL}
GIT_TAG ${BOOST_TAG}
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
)

# Check if population has already been performed
FetchContent_GetProperties(boost)
string(TOLOWER "${BOOST_NAME}" lcName)
Expand All @@ -32,7 +39,9 @@ if(USE_BOOST)
add_subdirectory(${${lcName}_SOURCE_DIR} ${${lcName}_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(boost)
list(APPEND LIB_MODULES ${Boost_LIBRARIES})
foreach(module IN LISTS BOOST_LIB_LIST)
list(APPEND LIB_MODULES ${module})
endforeach()
endif()
if(NOT BOOST_FOUND)
return()
Expand Down
22 changes: 16 additions & 6 deletions cmake/packages/FindCatch2.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
#Package Info.
# Package Info.
set(CATCH2_NAME "Catch2")
set(CATCH2_DESCRIPTION "A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch).")

#Pakcage option.
# Pakcage option.
option(USE_CATCH2 ${CATCH2_DESCRIPTION} FALSE)
if (USE_CATCH2)
add_definitions(-DUSE_CATCH2)
# Define the repository URL and tag for the Catch2 libraries
set(CATCH2_URL "https://github.com/catchorg/Catch2.git")
if(FORCE_UPGRADED_LIBS)
set(CATCH2_TAG "master")
else()
set(CATCH2_TAG "v3.3.2")
endif()
set(CATCH2_LIB_LIST "Catch2::Carch2" CACHE STRING "List of modules (separated by a semicolon)")
endif()

find_package(PkgConfig QUIET)
pkg_search_module(Catch2 catch2)
#Package data repository.
# Package data repository.
if(USE_CATCH2)
set(FETCHCONTENT_QUIET off)
get_filename_component(catch2_base "${CMAKE_CURRENT_SOURCE_DIR}/${THIRD_PARTY}/catch2"
REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
set(FETCHCONTENT_BASE_DIR ${catch2_base})
FetchContent_Declare(
catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG devel
GIT_REPOSITORY ${CATCH2_URL}
GIT_TAG ${CATCH2_TAG}
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
)
Expand All @@ -32,7 +40,9 @@ if(USE_CATCH2)
add_subdirectory(${${lcName}_SOURCE_DIR} ${${lcName}_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(catch2)
list(APPEND LIB_MODULES Catch2::Carch2)
foreach(module IN LISTS CATCH2_LIB_LIST)
list(APPEND LIB_MODULES ${module})
endforeach()
endif()
if(NOT CATCH2_FOUND)
return()
Expand Down
34 changes: 34 additions & 0 deletions cmake/packages/FindCell.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#Package Info.
set(ENGINE_NAME "Cell")
set(ENGINE_DESCRIPTION "Cell Engine is a new and exclusive cross-platform computer application engine based on Modern C++.")

message("Preparing for " ${ENGINE_NAME} "Engine")

find_package(PkgConfig QUIET)
pkg_search_module(${ENGINE_NAME} cell)
#Package data repository.

set(FETCHCONTENT_QUIET off)
get_filename_component(cell_base "${CMAKE_CURRENT_SOURCE_DIR}/${THIRD_PARTY}/${PLATFORM_FOLDER_NAME}/${ENGINE_NAME}"
REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
set(FETCHCONTENT_BASE_DIR ${cell_base})
FetchContent_Declare(
cell
GIT_REPOSITORY https://github.com/genyleap/cell.git
GIT_TAG main
GIT_PROGRESS TRUE
)
# Check if population has already been performed
FetchContent_GetProperties(cell)
string(TOLOWER "${ENGINE_NAME}" lcName)
if(NOT ${lcName}_POPULATED)
FetchContent_Populate(${lcName})
add_subdirectory(${${lcName}_SOURCE_DIR} ${${lcName}_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(cell)
include_directories(${${lcName}_INCLUDE_DIR})
list(APPEND LIB_MODULES cell_lib)

if(NOT CELL_FOUND)
return()
endif()
22 changes: 16 additions & 6 deletions cmake/packages/FindCtre.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
#Package Info.
# Package Info.
set(CTRE_NAME "Ctre")
set(CTRE_DESCRIPTION "A Compile time PCRE (almost) compatible regular expression matcher.")

#Pakcage option.
# Pakcage option.
option(USE_CTRE ${CTRE_DESCRIPTION} FALSE)
if (USE_CTRE)
add_definitions(-DUSE_CTRE)
# Define the repository URL and tag for the Ctre libraries
set(CTRE_URL "https://github.com/hanickadot/compile-time-regular-expressions.git")
if(FORCE_UPGRADED_LIBS)
set(CTRE_TAG "main")
else()
set(CTRE_TAG "v3.7.2")
endif()
set(CTRE_LIB_LIST "ctre" CACHE STRING "List of modules (separated by a semicolon)")
endif()

find_package(PkgConfig QUIET)
pkg_search_module(${DOCTEST_NAME} ctre)
#Package data repository.
# Package data repository.
if(USE_CTRE_NAME)
set(FETCHCONTENT_QUIET off)
get_filename_component(ctre_base "${CMAKE_CURRENT_SOURCE_DIR}/${THIRD_PARTY}/${PLATFORM_FOLDER_NAME}/${CTRE_NAME}"
REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
set(FETCHCONTENT_BASE_DIR ${ctre_base})
FetchContent_Declare(
ctre
GIT_REPOSITORY https://github.com/hanickadot/compile-time-regular-expressions.git
GIT_TAG main
GIT_REPOSITORY ${CTRE_URL}
GIT_TAG ${CTRE_TAG}
GIT_PROGRESS TRUE
)
# Check if population has already been performed
Expand All @@ -30,7 +38,9 @@ if(USE_CTRE_NAME)
add_subdirectory(${${lcName}_SOURCE_DIR} ${${lcName}_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(ctre)
list(APPEND LIB_MODULES ctre)
foreach(module IN LISTS CTRE_LIB_LIST)
list(APPEND LIB_MODULES ${module})
endforeach()
endif()
if(NOT CTRE_FOUND)
return()
Expand Down
17 changes: 13 additions & 4 deletions cmake/packages/FindDocTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ set(DOCTEST_DESCRIPTION "The fastest feature-rich C++11/14/17/20 single-header t
option(USE_DOC_TEST ${DOCTEST_DESCRIPTION} FALSE)
if (USE_DOC_TEST)
add_definitions(-DUSE_DOC_TEST)
# Define the repository URL and tag for the DocTest libraries
set(DOC_TEST_URL "https://github.com/onqtam/doctest")
if(FORCE_UPGRADED_LIBS)
set(DOC_TEST_TAG "master")
else()
set(DOC_TEST_TAG "v2.4.11")
endif()
set(DOC_TEST_LIB_LIST "doctest" CACHE STRING "List of modules (separated by a semicolon)")
endif()

find_package(PkgConfig QUIET)
Expand All @@ -17,8 +25,8 @@ if(USE_DOC_TEST)
set(FETCHCONTENT_BASE_DIR ${doctest_base})
FetchContent_Declare(
DocTest
GIT_REPOSITORY https://github.com/onqtam/doctest
GIT_TAG master
GIT_REPOSITORY ${DOC_TEST_URL}
GIT_TAG ${DOC_TEST_TAG}
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
)
Expand All @@ -30,8 +38,9 @@ if(USE_DOC_TEST)
add_subdirectory(${${lcName}_SOURCE_DIR} ${${lcName}_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(DocTest)
target_link_libraries(${PROJECT_NAME} PRIVATE doctest)
list(APPEND LIB_MODULES doctest)
foreach(module IN LISTS DOC_TEST_LIB_LIST)
list(APPEND LIB_MODULES ${module})
endforeach()
endif()
if(NOT DOCTEST_FOUND)
return()
Expand Down
22 changes: 16 additions & 6 deletions cmake/packages/FindEigen.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
#Package Info.
# Package Info.
set(EIGEN_NAME "Eigen")
set(EIGEN_DESCRIPTION "Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.")

#Pakcage option.
# Pakcage option.
option(USE_EIGEN ${EIGEN_DESCRIPTION} FALSE)
if (USE_EIGEN)
add_definitions(-DUSE_EIGEN)
# Define the repository URL and tag for the Eigen libraries
set(EIGEN_URL "https://gitlab.com/libeigen/eigen.git")
if(FORCE_UPGRADED_LIBS)
set(EIGEN_TAG "master")
else()
set(EIGEN_TAG "3.4")
endif()
set(EIGEN_LIB_LIST "eigen" CACHE STRING "List of modules (separated by a semicolon)")
endif()

find_package(PkgConfig QUIET)
pkg_search_module(${EIGEN_NAME} eigen)
#Package data repository.
# Package data repository.
if(USE_EIGEN)
set(FETCHCONTENT_QUIET off)
get_filename_component(eigen_base "${CMAKE_CURRENT_SOURCE_DIR}/${THIRD_PARTY}/${EIGEN_NAME}"
REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
set(FETCHCONTENT_BASE_DIR ${eigen_base})
FetchContent_Declare(
eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG master
GIT_REPOSITORY ${EIGEN_URL}
GIT_TAG ${EIGEN_TAG}
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
)
Expand All @@ -32,7 +40,9 @@ if(USE_EIGEN)
add_subdirectory(${${lcName}_SOURCE_DIR} ${${lcName}_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(eigen)
list(APPEND LIB_MODULES eigen)
foreach(module IN LISTS EIGEN_LIB_LIST)
list(APPEND LIB_MODULES ${module})
endforeach()
endif()
if(NOT EIGEN_FOUND)
return()
Expand Down
20 changes: 15 additions & 5 deletions cmake/packages/FindFmt.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#Package Info.
# Package Info.
set(FMT_NAME "Fmt")
set(FMT_DESCRIPTION "A modern formatting library.")

#Pakcage option.
# Pakcage option.
option(USE_FMT ${FMT_DESCRIPTION} FALSE)
if (USE_FMT)
add_definitions(-DUSE_FMT)
# Define the repository URL and tag for the Fmt libraries
set(FMT_URL "https://github.com/fmtlib/fmt.git")
if(FORCE_UPGRADED_LIBS)
set(FMT_TAG "master")
else()
set(FMT_TAG "9.1.0")
endif()
set(FMT_LIB_LIST "fmt::fmt-header-only" CACHE STRING "List of modules (separated by a semicolon)")
endif()

if(USE_FMT)
Expand All @@ -15,8 +23,8 @@ if(USE_FMT)
set(FETCHCONTENT_BASE_DIR ${fmt_base})
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG master
GIT_REPOSITORY ${FMT_URL}
GIT_TAG ${FMT_TAG}
GIT_PROGRESS TRUE
)
# Check if population has already been performed
Expand All @@ -27,7 +35,9 @@ if(USE_FMT)
add_subdirectory(${${lcName}_SOURCE_DIR} ${${lcName}_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(fmt)
list(APPEND LIB_MODULES fmt::fmt-header-only)
foreach(module IN LISTS FMT_LIB_LIST)
list(APPEND LIB_MODULES ${module})
endforeach()
endif()
if(NOT FMT_FOUND)
return()
Expand Down
Loading

0 comments on commit 854c7d6

Please sign in to comment.