Skip to content

Commit 6620eca

Browse files
committed
CMake improvements
1 parent 9c780e6 commit 6620eca

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
cmake_minimum_required(VERSION 3.21)
22

3-
project(SparserCpp)
3+
project(SparserCpp
4+
VERSION 0.1
5+
LANGUAGES CXX
6+
)
47

58
set(CMAKE_CXX_STANDARD 23)
69
set(CMAKE_CXX_STANDARD_REQUIRED True)

CMakePresets.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"binaryDir": "${sourceDir}/build"
2222
},
2323
{
24-
"name": "macos-arm",
24+
"name": "macos-arm-base",
25+
"hidden": true,
2526
"inherits": "base",
2627
"description": "Preset for ARM macOS",
2728
"generator": "Ninja",
2829
"cacheVariables": {
29-
"CMAKE_BUILD_TYPE": "Release",
3030
"CMAKE_SYSTEM_NAME": "Darwin",
3131
"VCPKG_TARGET_TRIPLET": "arm64-osx"
3232
}
@@ -45,9 +45,17 @@
4545
}
4646
}
4747
},
48+
{
49+
"name": "macos-arm-release",
50+
"inherits": "macos-arm-base",
51+
"description": "Release preset for ARM macOS",
52+
"cacheVariables": {
53+
"CMAKE_BUILD_TYPE": "Release"
54+
}
55+
},
4856
{
4957
"name": "macos-arm-debug",
50-
"inherits": "macos-arm",
58+
"inherits": "macos-arm-base",
5159
"description": "Debug preset for ARM macOS",
5260
"cacheVariables": {
5361
"CMAKE_BUILD_TYPE": "Debug"

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ add_subdirectory(sparser)
22

33
add_executable(SparserMain main.cpp)
44
target_link_libraries(SparserMain PRIVATE SparserCpp)
5-
target_link_libraries(SparserMain PRIVATE rapidjson)

src/sparser/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
add_library(SparserCpp sparser.cpp json_facade.cpp)
22
target_include_directories(SparserCpp PUBLIC ${CMAKE_SOURCE_DIR}/include)
3-
target_link_libraries(SparserCpp PRIVATE rapidjson)
3+
target_link_libraries(SparserCpp PUBLIC rapidjson)

tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
add_executable(sparser_test sparser_test.cpp)
22

33
target_link_libraries(sparser_test PRIVATE GTest::gtest_main SparserCpp)
4-
target_include_directories(sparser_test PRIVATE SparserCpp ${CMAKE_SOURCE_DIR}/include)
5-
64

75
include(GoogleTest)
86
gtest_discover_tests(sparser_test)

0 commit comments

Comments
 (0)