-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (40 loc) · 1.39 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
cmake_minimum_required(VERSION 3.10)
project(cinderbox VERSION "0.0.0")
include(FetchContent)
# Ensure Cinder is available
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cinder")
add_subdirectory(cinder)
else()
message(STATUS "Cinder does not exist in CinderBox root. Cloning...")
set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(
cinder
GIT_REPOSITORY https://github.com/cinder/Cinder.git
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
)
FetchContent_MakeAvailable(cinder)
endif()
# Ensure LibRapid is available
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/librapid")
add_subdirectory(librapid)
else()
message(STATUS "{fmt} does not exist in CinderBox root. Cloning...")
set(FETCHCONTENT_QUIET FALSE)
FetchContent_Declare(
librapid
GIT_REPOSITORY https://github.com/librapid/librapid
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
)
FetchContent_MakeAvailable(librapid)
endif()
set(CINDERBOX_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/gradient.cpp")
add_library(cinderbox STATIC ${CINDERBOX_SOURCES})
target_include_directories(cinderbox PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(cinderbox PUBLIC cinder)
target_link_libraries(cinderbox PUBLIC librapid)
# Fix a bug with MSVC
if (${MSVC})
target_link_options(cinderbox PUBLIC /SUBSYSTEM:WINDOWS)
endif()