-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmo2.cmake
More file actions
46 lines (34 loc) · 1.57 KB
/
mo2.cmake
File metadata and controls
46 lines (34 loc) · 1.57 KB
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
cmake_minimum_required(VERSION 3.22)
if (DEFINED MO2_DEFINED)
return()
endif()
option(MO2_INSTALL_IS_BIN
"if set, CMAKE_INSTALL_PREFIX is assumed to point to bin rather than one level below")
if (MO2_INSTALL_IS_BIN)
set(MO2_INSTALL_BIN ".")
else()
set(MO2_INSTALL_BIN "bin")
endif()
include(${CMAKE_CURRENT_LIST_DIR}/mo2_utils.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/mo2_versions.cmake)
# this makes VS install everything when building solution
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
# this find Python globally rather than virtual environments, even when one is active
set(Python_FIND_VIRTUALENV STANDARD)
# this set the imported location of targets for missing configurations - this silents
# many CMP0111 warnings from CMake
set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL MinSizeRel RelWithDebInfo Release None)
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release MinSizeRel None)
set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release RelWithDebInfo MinSizeRel None)
# allow setting folder property on targets for better organization in VS
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# put code generated by Qt in a autogen group in VS
set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP autogen)
set_property(GLOBAL PROPERTY AUTOMOC_SOURCE_GROUP autogen)
set_property(GLOBAL PROPERTY AUTORCC_SOURCE_GROUP autogen)
# put targets generated by Qt into a autogen folder (this is not the same as the above)
set(QT_TARGETS_FOLDER autogen)
include(${CMAKE_CURRENT_LIST_DIR}/mo2_cpp.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/mo2_python.cmake)
# mark as included
set(MO2_DEFINED true)