Skip to content

Commit 0185ac7

Browse files
committed
Add comments and update README.
1 parent 19d7ca6 commit 0185ac7

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

README.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,18 @@ configuration files.
4545

4646
## Usage
4747

48-
Be aware that using these utilities will automatically some (not too intrusive) global
49-
variable on your project.
50-
51-
For some functions to work properly, you should set `CMAKE_INSTALL_PREFIX` to a
52-
directory where `${CMAKE_INSTALL_PREFIX}/bin/ModOrganizer.exe` can be found.
48+
Be aware that using these utilities will automatically set some (not too intrusive)
49+
global variable on your project.
50+
51+
In order to properly use this package, you should set `CMAKE_INSTALL_PREFIX` to a valid
52+
location.
53+
There are two possible way of using this package controlled by the `MO2_INSTALL_IS_BIN`
54+
option:
55+
56+
- if `MO2_INSTALL_IS_BIN` is `OFF` (default), this assumes a layout with a `bin`,
57+
`lib`, `include` and `pdb` folder under `CMAKE_INSTALL_PREFIX`,
58+
- if `MO2_INSTALL_IS_BIN` is `ON` (default when building standalone), this assumes
59+
that `CMAKE_INSTALL_PREFIX` point directly to the equivalent `bin` folder.
5360

5461
Importing the utilities will make the following variables available:
5562

mo2.cmake

+10-2
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,31 @@ endif()
1616
include(${CMAKE_CURRENT_LIST_DIR}/mo2_versions.cmake)
1717
include(${CMAKE_CURRENT_LIST_DIR}/mo2_utils.cmake)
1818

19+
# this makes VS install everything when building solution
1920
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
2021

22+
# this find Python globally rather than virtual environments, even when one is active
2123
set(Python_FIND_VIRTUALENV STANDARD)
2224

25+
# this set the imported location of targets for missing configurations - this silents
26+
# many CMP0111 warnings from CMake
2327
set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL MinSizeRel RelWithDebInfo Release None)
2428
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release MinSizeRel None)
2529
set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release RelWithDebInfo MinSizeRel None)
2630

31+
# allow setting folder property on targets for better organization in VS
2732
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
33+
34+
# put code generated by Qt in a autogen group in VS
2835
set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP autogen)
2936
set_property(GLOBAL PROPERTY AUTOMOC_SOURCE_GROUP autogen)
3037
set_property(GLOBAL PROPERTY AUTORCC_SOURCE_GROUP autogen)
3138

39+
# put targets generated by Qt into a autogen folder (this is not the same as the above)
40+
set(QT_TARGETS_FOLDER autogen)
41+
3242
include(${CMAKE_CURRENT_LIST_DIR}/mo2_cpp.cmake)
3343
include(${CMAKE_CURRENT_LIST_DIR}/mo2_python.cmake)
3444

35-
set(QT_TARGETS_FOLDER autogen)
36-
3745
# mark as included
3846
set(MO2_DEFINED true)

0 commit comments

Comments
 (0)