forked from AcademySoftwareFoundation/OpenRV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
119 lines (100 loc) · 3.48 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
#
# Copyright (C) 2022 Autodesk, Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
CMAKE_MINIMUM_REQUIRED(VERSION 3.24)
# These variables are parsed by sphinx for the documentation.
# One-line formatting facilitates parsing and readability.
# cmake-format: off
SET(RV_MAJOR_VERSION "2" CACHE STRING "RV's version major")
SET(RV_MINOR_VERSION "0" CACHE STRING "RV's version minor")
SET(RV_REVISION_NUMBER "0" CACHE STRING "RV's revision number")
SET(RV_VERSION_YEAR "2024" CACHE STRING "RV's year of release.")
# cmake-format: on
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE
"Debug"
)
ENDIF()
IF(CMAKE_BUILD_TYPE
AND NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release)$"
)
MESSAGE(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
ENDIF()
IF (NOT RV_RELEASE_DESCRIPTION)
IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
SET(RV_RELEASE_DESCRIPTION
"DEVELOPMENT"
)
ELSE()
# as checked 'src/lib/app/RvCommon/RvApplication.cpp'
SET(RV_RELEASE_DESCRIPTION
"RELEASE"
)
ENDIF()
ENDIF()
SET(RV_UI_APPLICATION_NAME
"Open RV"
CACHE STRING "RV's UI application name"
)
SET(RV_INTERNAL_APPLICATION_NAME
"OpenRV"
CACHE STRING "RV's internal application name"
)
SET(RV_INTERNAL_ORGANIZATION_NAME
"ASWF"
CACHE STRING "RV's internal organization name"
)
SET(RV_INTERNAL_ORGANIZATION_DOMAIN
"aswf.com"
CACHE STRING "RV's internal organization domain"
)
IF(NOT RV_APPLICATION_TYPE)
SET(RV_APPLICATION_TYPE
${RV_INTERNAL_APPLICATION_NAME}
)
ENDIF()
PROJECT(
open-rv
VERSION "${RV_MAJOR_VERSION}.${RV_MINOR_VERSION}.${RV_REVISION_NUMBER}"
LANGUAGES CXX C
)
SET(CMAKE_CONFIGURATION_TYPES
"Debug;Release"
CACHE STRING "" FORCE
)
SET(CMAKE_BUILD_TYPE
"${CMAKE_BUILD_TYPE}"
CACHE STRING "CMake Build Type"
)
MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
MESSAGE("PROJECT DIR ${PROJECT_SOURCE_DIR}")
# Specify our own CMake modules so we can include them right after.
SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake/defaults ${PROJECT_SOURCE_DIR}/cmake/dependencies ${PROJECT_SOURCE_DIR}/cmake/globals
${PROJECT_SOURCE_DIR}/cmake/macros
)
INCLUDE(rv_options) # RV's build options
INCLUDE(rv_targets) # RV's build platform definitions
INCLUDE(rv_globals) # RV's CMake-build global variables
INCLUDE(rv_stage) # RV's local appplication packaging
INCLUDE(rv_vfx)
INCLUDE(CTest)
# The 'cxx_defaults' module will sets global C/C++ compiler defaults Note that variable such as 'CMAKE_CXX_COMPILER_ID' is only available after the 'project'
# statement just above.
INCLUDE(cxx_defaults)
# This should handle fetching or checking then compiling required 3rd party dependencies One can simple disable processing of a given dependency by simply
# commenting out the relevant line. (macOS) /usr/local/Cellar/cmake/3.20.3/share/cmake/Modules/FetchContent.cmake
INCLUDE(FetchContent) # once in the project to include the module
INCLUDE(ExternalProject) # once in the project to include the module
# Force verbosity of the FETCHCONTENT function, thus outputting some progress rather than just stalling CMake. Fetching and expanding an archive takes some
# time, as an indicator that something is actually happening, we'll force verbosity of the FETCHCONTENT function thus printing some minimal progress.
SET(FETCHCONTENT_QUIET
OFF
)
ADD_SUBDIRECTORY(cmake/dependencies)
# RV's main code
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(packages)
ADD_SUBDIRECTORY(cmake/install)