Skip to content

Commit 9f89618

Browse files
authored
Merge pull request #52 from PartStackerCommunity/vcpkg
Use vcpkg for thirdparty dependencies
2 parents 050b50e + 9464aab commit 9f89618

File tree

15 files changed

+40
-92
lines changed

15 files changed

+40
-92
lines changed

.gitmodules

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
[submodule "external/wxWidgets"]
2-
path = external/wxWidgets
3-
url = https://github.com/wxWidgets/wxWidgets.git
4-
[submodule "external/mdspan"]
5-
path = external/mdspan
6-
url = https://github.com/kokkos/mdspan.git
7-
[submodule "external/glew"]
8-
path = external/glew
9-
url = https://github.com/PartStackerCommunity/glew.git
10-
[submodule "external/Catch2"]
11-
path = external/Catch2
12-
url = https://github.com/catchorg/Catch2.git
1+
[submodule "external/vcpkg"]
2+
path = external/vcpkg
3+
url = https://github.com/microsoft/vcpkg.git

CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
cmake_minimum_required(VERSION 3.23)
1+
cmake_minimum_required(VERSION 3.30)
2+
3+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
4+
set(VCPKG_TARGET_TRIPLET "x64-windows-static-md" CACHE STRING "" FORCE)
5+
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
6+
set(VCPKG_TARGET_TRIPLET "x64-osx" CACHE STRING "" FORCE)
7+
else()
8+
message(FATAL_ERROR "Unsupported platform: ${CMAKE_HOST_SYSTEM_NAME}")
9+
endif()
210

311
project(PartStacker LANGUAGES CXX)
412

@@ -8,5 +16,9 @@ endif()
816

917
enable_testing()
1018

11-
add_subdirectory(external)
19+
find_package(Catch2 CONFIG REQUIRED)
20+
find_package(GLEW REQUIRED)
21+
find_package(mdspan CONFIG REQUIRED)
22+
find_package(wxWidgets CONFIG REQUIRED COMPONENTS core base net gl)
23+
1224
add_subdirectory(src)

CMakePresets.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"version": 3,
33
"cmakeMinimumRequired": {
44
"major": 3,
5-
"minor": 23,
5+
"minor": 30,
66
"patch": 0
77
},
88
"configurePresets": [
@@ -13,7 +13,8 @@
1313
"cacheVariables": {
1414
"CMAKE_CXX_STANDARD": "23",
1515
"CMAKE_CXX_STANDARD_REQUIRED": "ON",
16-
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
16+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
17+
"CMAKE_TOOLCHAIN_FILE": "external/vcpkg/scripts/buildsystems/vcpkg.cmake"
1718
}
1819
},
1920
{

external/CMakeLists.txt

Lines changed: 0 additions & 55 deletions
This file was deleted.

external/Catch2

Lines changed: 0 additions & 1 deletion
This file was deleted.

external/glew

Lines changed: 0 additions & 1 deletion
This file was deleted.

external/mdspan

Lines changed: 0 additions & 1 deletion
This file was deleted.

external/vcpkg

Submodule vcpkg added at f26ec39

external/wxWidgets

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/pstack/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ macro(pstack_add_test_executable target)
66
"${target}"
77
Catch2::Catch2WithMain
88
)
9+
get_target_property(component_name "${target}" PROJECT_LABEL)
910
set_target_properties("${target}_test" PROPERTIES
1011
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin/test"
12+
FOLDER "test"
13+
PROJECT_LABEL "${component_name}"
1114
)
12-
include("${PROJECT_SOURCE_DIR}/external/Catch2/extras/Catch.cmake")
15+
include("${Catch2_DIR}/Catch.cmake")
1316
catch_discover_tests("${target}_test")
1417
endmacro()
1518

0 commit comments

Comments
 (0)