-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,12 @@ CPMAddPackage("gh:TheLartians/[email protected]") | |
# CPMAddPackage( NAME nlohmann_json GITHUB_REPOSITORY nlohmann/json VERSION 3.9.1 OPTIONS | ||
# "JSON_BuildTests OFF" ) | ||
|
||
# Ensure static linking by setting CMAKE_FIND_LIBRARY_SUFFIXES | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") | ||
|
||
# Prefer static libraries over shared ones | ||
set(BUILD_SHARED_LIBS OFF) | ||
|
||
find_package(fmt REQUIRED) | ||
find_package(spdlog REQUIRED) | ||
find_package(cxxopts REQUIRED) | ||
|
@@ -45,7 +51,7 @@ file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/ | |
# ---- Create library ---- | ||
# add_library(filestorm ${headers} ${sources}) Note: for header-only libraries change all PUBLIC | ||
# flags to INTERFACE and create an interface target: add_library(${PROJECT_NAME} INTERFACE) | ||
add_library(${PROJECT_NAME} ${headers} ${sources}) | ||
add_library(${PROJECT_NAME} STATIC ${headers} ${sources}) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17) | ||
|
||
# being a cross-platform target, we enforce standards conformance on MSVC | ||
|
@@ -75,7 +81,7 @@ packageProject( | |
INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} | ||
VERSION_HEADER "${VERSION_HEADER_LOCATION}" | ||
COMPATIBILITY SameMajorVersion | ||
DEPENDENCIES "spdlog;fmt" CPACK YES | ||
# DEPENDENCIES "spdlog;fmt" CPACK YES | ||
) | ||
|
||
file(GLOB standalone_sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/standalone/source/*.cpp) | ||
|
@@ -92,7 +98,7 @@ install(TARGETS ${PROJECT_NAME}Executable RUNTIME DESTINATION ${CMAKE_INSTALL_BI | |
COMPONENT "${PROJECT_NAME}_Runtime" | ||
) | ||
|
||
set(CPACK_RPM_PACKAGE_REQUIRES "spdlog, fmt") | ||
# set(CPACK_RPM_PACKAGE_REQUIRES "spdlog, fmt") | ||
set(CPACK_RPM_BUILDREQUIRES | ||
"cmake, gcc-c++, spdlog-devel, fmt-devel, git, cxxopts-devel, json-devel" | ||
) | ||
|