Add project
This commit is contained in:
24
cmake/CPM.cmake
Normal file
24
cmake/CPM.cmake
Normal file
@@ -0,0 +1,24 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
|
||||
|
||||
set(CPM_DOWNLOAD_VERSION 0.42.1)
|
||||
set(CPM_HASH_SUM "f3a6dcc6a04ce9e7f51a127307fa4f699fb2bade357a8eb4c5b45df76e1dc6a5")
|
||||
|
||||
if(CPM_SOURCE_CACHE)
|
||||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
|
||||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
else()
|
||||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
endif()
|
||||
|
||||
# Expand relative path. This is important if the provided path contains a tilde (~)
|
||||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
|
||||
|
||||
file(DOWNLOAD
|
||||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
|
||||
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
|
||||
)
|
||||
|
||||
include(${CPM_DOWNLOAD_LOCATION})
|
||||
14
cmake/compileCommands.cmake
Normal file
14
cmake/compileCommands.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
##### SETUP COMPILE COMMANDS #####
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
|
||||
endif()
|
||||
|
||||
if(EXISTS "${CMAKE_BINARY_DIR}/compile_commands.json")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
file(
|
||||
COPY "${CMAKE_BINARY_DIR}/compile_commands.json"
|
||||
DESTINATION "${CMAKE_BINARY_DIR}/../"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
10
cmake/platform.cmake
Normal file
10
cmake/platform.cmake
Normal file
@@ -0,0 +1,10 @@
|
||||
message("System name: ${CMAKE_HOST_SYSTEM_NAME}")
|
||||
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
|
||||
add_compile_definitions(PLATFORM_WINDOWS)
|
||||
elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
|
||||
add_compile_definitions(PLATFORM_LINUX)
|
||||
elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
add_compile_definitions(PLATFORM_MACOS)
|
||||
else()
|
||||
add_compile_definitions(PLATFORM_UNKNOWN)
|
||||
endif()
|
||||
3
cmake/spdlog.cmake
Normal file
3
cmake/spdlog.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
CPMAddPackage(
|
||||
URI "gh:gabime/spdlog@1.17.0"
|
||||
)
|
||||
5
cmake/structopt.cmake
Normal file
5
cmake/structopt.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
CPMAddPackage(
|
||||
URI "gh:p-ranav/structopt@0.1.3"
|
||||
OPTIONS "STRUCTOPT_TESTS off"
|
||||
OPTIONS "STRUCTOPT_SAMPLES off"
|
||||
)
|
||||
Reference in New Issue
Block a user