-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
56 lines (44 loc) · 1.96 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
cmake_minimum_required(VERSION 3.20)
set(CMAKE_CXX_STANDARD 20)
set(EXECUTABLE_OUTPUT_PATH ../)
project(plugin-template)
set(NAMESPACE polymorph)
if (${CMAKE_SOURCE_DIR} EQUAL ${PROJECT_NAME})
set(LIBRARY_OUTPUT_PATH ../)
elseif(POLYMORPH_ENGINE_PLUGINS_CONFIG_PATH)
set(LIBRARY_OUTPUT_PATH ${POLYMORPH_ENGINE_PLUGINS_CONFIG_PATH}/Plugins/${PROJECT_NAME})
else()
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Plugins/${PROJECT_NAME})
endif()
#set(CMAKE_MODULE /usr/bin/clang)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-memory-track-origins -fsanitize=memory -fsanitize-recover=all -fPIE -pie -fno-omit-frame-pointer -fno-optimize-sibling-calls -O1")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
include(CMake/FindPolymorphEngine.cmake)
file(GLOB_RECURSE SCRIPTS_SRC Scripts/src/*.cpp)
file(GLOB_RECURSE SCRIPTS_ICL Scripts/include/*.hpp)
file(GLOB_RECURSE FACTORY_SRC Factory/src/*.cpp)
file(GLOB_RECURSE FACTORY_ICL Factory/include/*.hpp)
file(GLOB_RECURSE CORE_SRC Core/src/*.cpp)
file(GLOB_RECURSE CORE_ICL Core/include/*.hpp)
file(GLOB_RECURSE EXPORTS IncludeExport/*.hpp)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(${PROJECT_NAME} SHARED ${SCRIPTS_SRC} ${SCRIPTS_ICL} ${FACTORY_SRC} ${FACTORY_ICL} ${CORE_SRC} ${CORE_ICL} ${EXPORTS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
target_include_directories(${PROJECT_NAME} PRIVATE
Scripts/include
Factory/include
Core/include
)
target_include_directories(${PROJECT_NAME} PUBLIC
IncludeExport
)
target_link_libraries(${PROJECT_NAME} PolymorphEngine)
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
if(WIN32)
# MSVC
target_compile_options(${PROJECT_NAME} PRIVATE /EHsc /W2 /c /Zc:preprocessor /wd5105)
# Set the DLLEXPORT variable to export symbols
target_compile_definitions(${PROJECT_NAME} PRIVATE WIN_EXPORT)
endif()
include(CMake/CopyConfig.cmake)