This commit is contained in:
@ -6,8 +6,12 @@ execute_process(
|
||||
)
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
get_filename_component(PROJECT_EXE_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
|
||||
project(${PROJECT_EXE_NAME} VERSION ${PROJECT_VERSION} LANGUAGES CXX)
|
||||
if(NOT DEFINED PROJECT_NAME)
|
||||
message(FATAL_ERROR "PROJECT_NAME is not defined. Pass it via -DPROJECT_NAME=<name>")
|
||||
endif()
|
||||
|
||||
project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES CXX)
|
||||
set(PROJECT_EXE_NAME ${PROJECT_NAME})
|
||||
|
||||
# Force static linking globally
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
@ -64,6 +68,32 @@ target_include_directories(${PROJECT_EXE_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
|
||||
# Configure libassert
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
libassert
|
||||
GIT_REPOSITORY https://github.com/jeremy-rifkin/libassert.git
|
||||
GIT_TAG v2.1.5
|
||||
)
|
||||
FetchContent_MakeAvailable(libassert)
|
||||
|
||||
# Add cpptrace
|
||||
FetchContent_Declare(
|
||||
cpptrace
|
||||
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
|
||||
GIT_TAG v0.8.3
|
||||
)
|
||||
FetchContent_MakeAvailable(cpptrace)
|
||||
|
||||
# Add nlohmann/json
|
||||
FetchContent_Declare(
|
||||
nlohmann_json
|
||||
GIT_REPOSITORY https://github.com/nlohmann/json.git
|
||||
GIT_TAG v3.12.0
|
||||
)
|
||||
FetchContent_MakeAvailable(nlohmann_json)
|
||||
|
||||
# Link libraries
|
||||
target_link_libraries(${PROJECT_EXE_NAME} PRIVATE
|
||||
libassert::assert
|
||||
|
Reference in New Issue
Block a user