Skip to content

Commit

Permalink
Add comments and update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Aug 5, 2024
1 parent 19d7ca6 commit 0185ac7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,18 @@ configuration files.

## Usage

Be aware that using these utilities will automatically some (not too intrusive) global
variable on your project.

For some functions to work properly, you should set `CMAKE_INSTALL_PREFIX` to a
directory where `${CMAKE_INSTALL_PREFIX}/bin/ModOrganizer.exe` can be found.
Be aware that using these utilities will automatically set some (not too intrusive)
global variable on your project.

In order to properly use this package, you should set `CMAKE_INSTALL_PREFIX` to a valid
location.
There are two possible way of using this package controlled by the `MO2_INSTALL_IS_BIN`
option:

- if `MO2_INSTALL_IS_BIN` is `OFF` (default), this assumes a layout with a `bin`,
`lib`, `include` and `pdb` folder under `CMAKE_INSTALL_PREFIX`,
- if `MO2_INSTALL_IS_BIN` is `ON` (default when building standalone), this assumes
that `CMAKE_INSTALL_PREFIX` point directly to the equivalent `bin` folder.

Importing the utilities will make the following variables available:

Expand Down
12 changes: 10 additions & 2 deletions mo2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,31 @@ endif()
include(${CMAKE_CURRENT_LIST_DIR}/mo2_versions.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/mo2_utils.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)

set(QT_TARGETS_FOLDER autogen)

# mark as included
set(MO2_DEFINED true)

0 comments on commit 0185ac7

Please sign in to comment.