forked from jeremyjh/Spriter2dX
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
55 lines (47 loc) · 1.62 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
cmake_minimum_required(VERSION 3.12)
project(spriter2dx VERSION 1.0 LANGUAGES CXX)
include(FetchContent)
include(ExternalProject)
## tinyxml2
FetchContent_Declare(tinyxml2
GIT_REPOSITORY https://github.com/leethomason/TinyXML2
GIT_TAG 9.0.0
)
FetchContent_GetProperties(tinyxml2)
if(NOT tinyxml2_POPULATED)
FetchContent_Populate(tinyxml2)
add_subdirectory(${tinyxml2_SOURCE_DIR} ${tinyxml2_BINARY_DIR})
endif()
set(TINYXML2_INCLUDE_DIRS ${tinyxml2_SOURCE_DIR})
add_library(spriter2dx STATIC
include/spriter2dx/ccimagefile.cpp
include/spriter2dx/ccsoundfile.cpp
include/spriter2dx/ccfilefactory.cpp
include/spriter2dx/ccsoundobjectinforeference.cpp
include/spriter2dx/ccobjectfactory.cpp
include/spriter2dx/cctriggerobjectinfo.cpp
include/spriter2dx/ccboxinstanceinfo.cpp
include/spriter2dx/ccboneinstanceinfo.cpp
include/spriter2dx/ccpointinstanceinfo.cpp
include/spriter2dx/tinyxmlspriterfileattributewrapper.cpp
include/spriter2dx/tinyxmlspriterfiledocumentwrapper.cpp
include/spriter2dx/tinyxmlspriterfileelementwrapper.cpp
include/spriter2dx/AnimationNode.cpp
)
add_library(spriter2dx::spriter2dx ALIAS spriter2dx)
target_compile_features(spriter2dx PUBLIC cxx_std_11)
target_include_directories(spriter2dx
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
${TINYXML2_INCLUDE_DIRS}
PRIVATE
${PROJECT_SOURCE_DIR}/include/spriter2dx
)
target_link_libraries(spriter2dx PUBLIC
spriterplusplus::spriterengine
cocos2d::cocos2d
${TINYXML2_LIBRARIES}
)
set_target_properties(spriter2dx PROPERTIES
POSITION_INDEPENDENT_CODE ON
)