-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
119 lines (95 loc) · 3.06 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
cmake_minimum_required(VERSION 3.4.1)
project(FbxConverter)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
message(STATUS "CMAKE_SYSTEM_INFO_FILE = ${CMAKE_SYSTEM_INFO_FILE}")
message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
message(STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "CMAKE_SYSTEM = ${CMAKE_SYSTEM}")
message(STATUS "CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}")
message(STATUS "CMAKE_BINARY_DIR = ${CMAKE_BINARY_DIR}")
find_package(wxWidgets REQUIRED core base adv propgrid)
include(${wxWidgets_USE_FILE})
set(FBXSDK_ROOT "" CACHE PATH "Root of FBX SDK on disk")
foreach (FBXSDK_VERSION "2020_2")
find_package(FBX)
if (FBXSDK_FOUND)
break()
endif()
endforeach(FBXSDK_VERSION)
if (NOT FBXSDK_FOUND)
message(FATAL_ERROR
"Can't find FBX SDK."
)
endif()
set( default_cmake_args
-G "Ninja"
-B${BUILD_FOLDER_SUFFIX} "-H." )
file(
GLOB
fbxconverter_source
${CMAKE_SOURCE_DIR}/*.cpp
)
file(
GLOB
fbxconverter_headers
${CMAKE_SOURCE_DIR}/*.h
)
add_executable(
FbxConverter WIN32
${fbxconverter_source}
${fbxconverter_headers}
)
target_include_directories(
FbxConverter
PUBLIC
${CMAKE_SOURCE_DIR}/generated
${FBXSDK_INCLUDE_DIR}
)
set (CMAKE_CXX_STANDARD 14)
set(CONFIGURATION_SUFFIX "/$(Configuration)")
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_CRT_SECURE_NO_WARNINGS")
# this will suffice for now; don't really care about 32-bit
set(LIBXML2_INCLUDE_DIRS ${FBXSDK_INCLUDE_DIR})
set(LIBXML2_LIBRARIES ${FBXSDK_ROOT}/lib/vs2019/x64/release/libxml2-md.lib)
set(LIBXML2_LIBRARIES_DEBUG ${FBXSDK_ROOT}/lib/vs2019/x64/debug/libxml2-md.lib)
if (NOT LIBXML2_INCLUDE_DIRS OR NOT LIBXML2_LIBRARIES)
message(FATAL_ERROR "Cannot find libxml2.lib in the expected location.")
endif()
set(ZLIB_INCLUDE_DIRS ${FBXSDK_INCLUDE_DIR})
set(ZLIB_LIBRARIES ${FBXSDK_ROOT}/lib/vs2019/x64/release/zlib-md.lib)
set(ZLIB_LIBRARIES_DEBUG ${FBXSDK_ROOT}/lib/vs2019/x64/debug/zlib-md.lib)
if (NOT ZLIB_LIBRARIES)
message(FATAL_ERROR "Cannot find zlib.lib in the expected location.")
endif()
set(
third_party_libs
${wxWidgets_LIBRARIES}
debug ${LIBXML2_LIBRARIES_DEBUG}
optimized ${LIBXML2_LIBRARIES}
debug ${ZLIB_LIBRARIES_DEBUG}
optimized ${ZLIB_LIBRARIES}
winmm.lib
imm32.lib
version.lib
)
target_compile_definitions(FbxConverter PUBLIC "FBX_DEFINE_NAMESPACE=0" "FBX_USE_NAMESPACE=0")
target_link_libraries(
FbxConverter
debug ${FBXSDK_LIBRARY_DEBUG}
optimized ${FBXSDK_LIBRARY}
${third_party_libs}
)
link_directories(
FbxConverter
)
set_target_properties(
FbxConverter
PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY
"$(OutDir)"
)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(PREDEFINED_TARGETS_FOLDER "CustomTargets")