forked from nem0/OpenFBX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (38 loc) · 1.42 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
cmake_minimum_required(VERSION 3.11)
project(OpenFBX LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
include(GNUInstallDirs)
find_package(libdeflate REQUIRED)
add_library(OpenFBX src/ofbx.cpp)
target_link_libraries(OpenFBX PRIVATE $<IF:$<TARGET_EXISTS:libdeflate::libdeflate_shared>,libdeflate::libdeflate_shared,libdeflate::libdeflate_static>)
target_include_directories(OpenFBX
PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/>)
target_compile_definitions(OpenFBX PRIVATE _LARGEFILE64_SOURCE)
set_target_properties(OpenFBX PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS ON
POSITION_INDEPENDENT_CODE ON)
install(TARGETS OpenFBX EXPORT openfbxTargets
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
INCLUDES DESTINATION include)
include(CMakePackageConfigHelpers)
configure_package_config_file(
openfbxConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/openfbxConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_DATADIR}/openfbx"
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/openfbxConfig.cmake"
DESTINATION "${CMAKE_INSTALL_DATADIR}/openfbx"
)
install(
EXPORT openfbxTargets
FILE openfbxTargets.cmake
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openfbx
)
install(FILES ${CMAKE_SOURCE_DIR}/src/ofbx.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)