-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
38 lines (30 loc) · 941 Bytes
/
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
cmake_minimum_required(VERSION 3.0.2)
project(entt_example)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(thirdparty/godot-cpp/)
add_subdirectory(thirdparty/entt/)
if(MSVC)
# Force to always compile with W4
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
set(SPACESHIP_SRC
src/gdlibrary.cpp
src/Entity.cpp
src/EntityManager.cpp
)
set(BUILD_PATH ${CMAKE_SOURCE_DIR}/bin)
add_library(entt_example SHARED ${SPACESHIP_SRC})
target_link_libraries(entt_example
${GODOT_CPP_LIB}
godot-cpp
EnTT
)
# create the library directly in the right folder
set_target_properties(entt_example PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)