-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPreLoad.cmake
More file actions
19 lines (18 loc) · 825 Bytes
/
PreLoad.cmake
File metadata and controls
19 lines (18 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Use Ninja instead of Unix Makefiles by default.
# https://stackoverflow.com/questions/11269833/cmake-selecting-a-generator-within-cmakelists-txt
#
# Reason: it have better startup time than make and it parallelize jobs more uniformly.
# (when comparing to make with Makefiles that was generated by CMake)
#
# How to install Ninja on Ubuntu:
# sudo apt-get install ninja-build
if (NOT WIN32)
find_program(NINJA_PATH ninja)
if (NINJA_PATH)
execute_process(COMMAND ninja --version OUTPUT_VARIABLE NINJA_VERSION)
string(REGEX REPLACE "\n$" "" NINJA_VERSION "${NINJA_VERSION}")
set(GENERATOR_PATH "${NINJA_PATH}" CACHE INTERNAL "" FORCE)
set(BUILD_TOOL_VERSION "${NINJA_VERSION}" CACHE INTERNAL "" FORCE)
set(CMAKE_GENERATOR "Ninja" CACHE INTERNAL "" FORCE)
endif()
endif()