-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
64 lines (48 loc) · 2 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
# CMakeList.txt : CMake project for LayerMatNode, include source and define
# project specific logic here.
#
cmake_minimum_required(VERSION 3.8)
project("LayerMatNode")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/plugin)
# Enable C++11 for host code
set(CMAKE_CXX_STANDARD 17)
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
set(ARNOLD_DIR "$ENV{ARNOLD_PATH}")
include_directories("${ARNOLD_DIR}/include/arnold")
file(GLOB_RECURSE core_headers
"${CMAKE_SOURCE_DIR}/src/*.h"
"${CMAKE_SOURCE_DIR}/src/*.hpp")
file(GLOB_RECURSE core_sources
"${CMAKE_SOURCE_DIR}/src/*.c"
"${CMAKE_SOURCE_DIR}/src/*.cpp")
if(MSVC_IDE)
# Macro to preserve source files hierarchy in the IDE
macro(GroupSources curdir)
file(GLOB children RELATIVE ${PROJECT_SOURCE_DIR}/${curdir} ${PROJECT_SOURCE_DIR}/${curdir}/*)
foreach(child ${children})
if(IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${curdir}/${child})
GroupSources(${curdir}/${child})
else()
string(REPLACE "/" "\\" groupname ${curdir})
string(REPLACE "src" "Sources" groupname ${groupname})
source_group(${groupname} FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child})
endif()
endforeach()
endmacro()
GroupSources(src)
endif()
# Add source to this project's executable.
add_library(${CMAKE_PROJECT_NAME} SHARED ${core_headers} ${core_sources})
target_link_libraries(${CMAKE_PROJECT_NAME} "${ARNOLD_DIR}/lib/ai.lib")
if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 20)
endif()
# TODO: Add tests and install targets if needed.