forked from Toolchefs/atomsGaffer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
72 lines (59 loc) · 2.91 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
cmake_minimum_required(VERSION 3.0)
project(AtomsGaffer)
option( USE_GAFFER_DEPENDENCIES "Turn this off you're building against your own dependencies (eg boost, python, tbb, exr, cortex) rather than the versions included with Gaffer" ON )
set(CMAKE_VERBOSE_MAKEFILE ON)
if(ATOMS_MAYA_ROOT)
set(ATOMS_INCLUDE_PATH ${ATOMS_MAYA_ROOT}/include)
set(ATOMS_LIB_PATH ${ATOMS_MAYA_ROOT}/lib/${MAYA_MAJOR_VERSION})
set(ATOMS_ICONS_PATH ${ATOMS_MAYA_ROOT}/icons)
endif()
if(ATOMS_ROOT)
set(ATOMS_INCLUDE_PATH ${ATOMS_ROOT}/include)
set(ATOMS_LIB_PATH ${ATOMS_ROOT}/lib)
set(ATOMS_ICONS_PATH ${ATOMS_ROOT}/icons)
endif()
if(USE_GAFFER_DEPENDENCIES)
set(BOOST_INCLUDE_PATH ${GAFFER_ROOT}/include)
set(PYTHON_ROOT ${GAFFER_ROOT})
set(TBB_ROOT ${GAFFER_ROOT})
set(OPENEXR_ROOT ${GAFFER_ROOT})
set(CORTEX_ROOT ${GAFFER_ROOT})
endif()
set(DEPENDENCY_INCLUDE_PATHS
${BOOST_INCLUDE_PATH}
${TBB_ROOT}/include
${OPENEXR_ROOT}/include
${OPENEXR_ROOT}/include/OpenEXR
${CORTEX_ROOT}/include
${GAFFER_ROOT}/include
${ATOMS_INCLUDE_PATH}
)
# build the library
file( GLOB AtomsGafferSrc src/AtomsGaffer/*.cpp )
link_directories( AtomsGaffer ${GAFFER_ROOT}/lib ${ATOMS_LIB_PATH} )
add_library( AtomsGaffer SHARED ${AtomsGafferSrc} )
target_compile_definitions( AtomsGaffer PRIVATE BOOST_SIGNALS_NO_DEPRECATION_WARNING=1 LINUX=1 _GLIBCXX_USE_CXX11_ABI=0)
target_include_directories( AtomsGaffer SYSTEM PRIVATE ${DEPENDENCY_INCLUDE_PATHS} )
target_include_directories( AtomsGaffer PRIVATE include )
target_link_libraries( AtomsGaffer Gaffer GafferScene AtomsCore AtomsGraph Atoms AtomsUtils )
install( TARGETS AtomsGaffer DESTINATION lib )
# build the python bindings
file( GLOB AtomsGafferModuleSrc src/AtomsGafferModule/*.cpp )
add_library( AtomsGafferModule SHARED ${AtomsGafferModuleSrc} )
set_target_properties( AtomsGafferModule PROPERTIES PREFIX "" OUTPUT_NAME "_AtomsGaffer" )
target_compile_definitions( AtomsGafferModule PRIVATE BOOST_SIGNALS_NO_DEPRECATION_WARNING=1 LINUX=1 _GLIBCXX_USE_CXX11_ABI=0)
target_link_libraries( AtomsGafferModule AtomsGaffer )
target_include_directories( AtomsGafferModule SYSTEM PRIVATE ${DEPENDENCY_INCLUDE_PATHS} ${PYTHON_ROOT}/include/python${PYTHON_VERSION} )
target_include_directories( AtomsGafferModule PRIVATE include )
target_link_libraries( AtomsGafferModule GafferBindings )
install( TARGETS AtomsGafferModule DESTINATION python/AtomsGaffer )
# build the python modules
install( DIRECTORY python DESTINATION . FILES_MATCHING PATTERN "*.py" )
# build the startup configs
install( DIRECTORY startup DESTINATION . FILES_MATCHING PATTERN "*.py" )
# build the graphics
install( FILES ${ATOMS_ICONS_PATH}/logo_new.png DESTINATION graphics RENAME atoms_logo.png )
# build the examples
file( GLOB AtomsGafferExampleScripts examples/scripts/*.gfr )
install( FILES ${AtomsGafferExampleScripts} DESTINATION examples/scripts )
install( DIRECTORY examples/assets DESTINATION examples )