-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (47 loc) · 2.5 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.21.2)
set(VCPKG_LIBRARY_LINKAGE static)
if (WIN32)
#set(VCPKG_TARGET_TRIPLET x64-windows)
include("$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
elseif (UNIX)
set(VCPKG_TARGET_TRIPLET x64-linux)
include("/home/ilies/GameDev/Libraries/vcpkg/scripts/buildsystems/vcpkg.cmake")
endif()
project(MapGeneratorProject VERSION 0.1.0 LANGUAGES CXX)
include(CTest)
enable_testing()
add_library(DiskSampling include/DiskSampling/PoissonDiskSampling.h src/DiskSampling/PoissonDiskSampling.cpp)
add_library(MarkovChain include/MarkovChain/MarkovChain.h src/MarkovChain/MarkovChain.cpp)
add_library(MapGenerator include/MapGenerator/Structures.h include/MapGenerator/Quadtree.h include/MapGenerator/Map.h include/MapGenerator/dDelaunay.h include/MapGenerator/Math/LineEquation.h include/MapGenerator/Math/Vec2.h
src/MapGenerator/Structures.cpp src/MapGenerator/Map.cpp src/MapGenerator/dDelaunay.cpp src/MapGenerator/Math/LineEquation.cc src/MapGenerator/Math/Vec2.cpp)
add_executable(MapGeneratorEx MapGeneratorSource.cpp)
add_executable(MarkovNamesEx MarkovChainSource.cpp)
target_compile_features(MarkovNamesEx PUBLIC cxx_std_11)
target_compile_features(MapGeneratorEx PUBLIC cxx_std_11)
target_include_directories(DiskSampling PUBLIC include)
target_include_directories(MarkovChain PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/")
target_include_directories(MapGenerator PUBLIC include)
target_link_libraries(MapGeneratorEx PUBLIC MapGenerator DiskSampling MarkovChain)
target_link_libraries(MarkovNamesEx PUBLIC MarkovChain)
find_package(unofficial-noise CONFIG REQUIRED)
find_package(unofficial-noiseutils CONFIG REQUIRED)
if(WIN32)
target_link_libraries(MapGenerator PUBLIC unofficial::noise::noise)
target_link_libraries(MapGenerator PUBLIC unofficial::noiseutils::noiseutils)
elseif(UNIX)
target_link_libraries(MapGenerator PUBLIC unofficial::noise::noise-static)
target_link_libraries(MapGenerator PUBLIC unofficial::noiseutils::noiseutils-static)
endif()
# Find and link SFML components
find_package(SFML COMPONENTS system window graphics CONFIG REQUIRED)
target_link_libraries(MapGenerator PUBLIC sfml-system sfml-network sfml-graphics sfml-window)
find_package(ImGui-SFML CONFIG REQUIRED)
target_link_libraries(MapGenerator PRIVATE ImGui-SFML::ImGui-SFML)
# Link SFML main implementation
if(WIN32)
target_link_libraries(MapGenerator PUBLIC sfml-main)
elseif(UNIX)
endif()
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)