-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
101 lines (74 loc) · 3.82 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
cmake_minimum_required(VERSION 3.10.0)
project(Infinite VERSION 0.1.0)
option(DOWNLOAD_PNGPP "Download libpng++ 2.10 from launchpad" OFF)
# ASAN options
if(OFF)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fsanitize=address PARENT_SCOPE)
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address PARENT_SCOPE)
set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address PARENT_SCOPE)
endif()
if(WIN32 AND NOT CREATE_DLL)
add_library(Infinite)
else()
add_library(Infinite SHARED)
endif()
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/3rd_party/detex)
target_link_libraries(Infinite detex)
target_include_directories(Infinite PRIVATE ${CMAKE_CURRENT_LIST_DIR}/3rd_party/detex)
find_package(PNG REQUIRED)
target_link_libraries(Infinite ${PNG_LIBRARIES})
find_package(jsoncpp REQUIRED)
target_link_libraries(Infinite jsoncpp)
get_target_property(JSON_INC_PATH jsoncpp_lib INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "JSON include path: ${JSON_INC_PATH}")
target_include_directories(Infinite PRIVATE ${JSON_INC_PATH})
# libpng++ is also needed, but not available in msys2
if(DOWNLOAD_PNGPP)
include(ExternalProject)
message(STATUS "Downloading libpng++ 2.10 from launchpad")
ExternalProject_Add(png++ URL "https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/png++/0.2.10-1/png++_0.2.10.orig.tar.gz" LOG_DOWNLOAD ON CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" SOURCE_DIR "include-png++/png++")
add_dependencies(Infinite png++)
message(STATUS "PNG++ include dir: ${CMAKE_CURRENT_BINARY_DIR}/include-png++/")
target_include_directories(Infinite PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/include-png++/")
endif()
if(NOT DEFINED OODLE_LIBRARY)
set(OODLE_LIBRARY ${CMAKE_CURRENT_LIST_DIR}/liblinoodle.so)
endif()
message(STATUS "Using oodle from ${OODLE_LIBRARY}")
#include_directories(${GTKMM_INCLUDE_DIRS})
#target_link_directories(infiniteExplorer ${GTKMM_LIBRARY_DIRS})
#target_include_directories(Infinite PRIVATE ${GTKMM_INCLUDE_DIRS})
set_property(TARGET Infinite PROPERTY CXX_STANDARD 20)
target_include_directories(Infinite PUBLIC .)
target_sources(Infinite PRIVATE ${CMAKE_CURRENT_LIST_DIR}/DataTable.cpp ${CMAKE_CURRENT_LIST_DIR}/ContentTable.cpp)
target_sources(Infinite PRIVATE ${CMAKE_CURRENT_LIST_DIR}/TagRefFieldTable.cpp ${CMAKE_CURRENT_LIST_DIR}/Item.cpp)
target_sources(Infinite PRIVATE ${CMAKE_CURRENT_LIST_DIR}/Header.cpp ${CMAKE_CURRENT_LIST_DIR}/TagRefTable.cpp)
target_sources(Infinite PRIVATE ${CMAKE_CURRENT_LIST_DIR}/DataRefTable.cpp)
target_sources(Infinite PRIVATE ${CMAKE_CURRENT_LIST_DIR}/BitmapHandle.cpp
${CMAKE_CURRENT_LIST_DIR}/contentUtils.cpp
${CMAKE_CURRENT_LIST_DIR}/BitmapBatchExtractor.cpp
${CMAKE_CURRENT_LIST_DIR}/MaterialJsonExporter.cpp
${CMAKE_CURRENT_LIST_DIR}/StringIDLUT.cpp)
include(${CMAKE_CURRENT_LIST_DIR}/module/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/logger/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/tags/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/models/CMakeLists.txt)
#include(${CMAKE_CURRENT_LIST_DIR}/utils/CMakeLists.txt)
#target_link_libraries(infiniteExplorer ${GTKMM_LIBRARIES})
#link against oodle (or linoodle)
if(WIN32)
add_library(oodle MODULE IMPORTED)
else()
add_library(oodle SHARED IMPORTED)
endif()
set_target_properties(oodle PROPERTIES IMPORTED_LOCATION ${OODLE_LIBRARY})
target_link_libraries(Infinite oodle)
if(USE_COMPRESSONATOR)
target_link_libraries(Infinite CMP_Compressonator)
target_include_directories(Infinite PRIVATE ${COMPRESSONATOR_DIR}/cmp_compressonatorlib)
endif()
#set(LIBINFINITE_LIBRARY_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/libInfinite.so PARENT_SCOPE)
if(${INFINITE_COPY_OODLE_DLL})
configure_file(${CMAKE_CURRENT_LIST_DIR}/${INFINITE_OODLE_DLL} ${INFINITE_OODLE_DLL} COPYONLY)
endif()
configure_file(${CMAKE_CURRENT_LIST_DIR}/3rd_party/detex/LICENSE detex_LICENSE COPYONLY)