build: streamline CMAKE_MODULE_PATH interaction
This commit is contained in:
parent
e3743cc01f
commit
c0ff16e3ac
3 changed files with 14 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
# clangd (run via lsp) keeps state here
|
# clangd (run via lsp) keeps state here
|
||||||
.cache
|
.cache
|
||||||
# typical build directory
|
# typical build directory
|
||||||
build
|
.build
|
||||||
# compile_commands.json: symlink to build directory, should be created manually
|
# compile_commands.json: symlink to build directory, should be created manually
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,7 @@ cmake_minimum_required(VERSION 3.10)
|
||||||
project(randomgen VERSION 0.1)
|
project(randomgen VERSION 0.1)
|
||||||
enable_language(CXX)
|
enable_language(CXX)
|
||||||
|
|
||||||
include(xo_macros/xo_cxx)
|
include(cmake/xo-bootstrap-macros.cmake)
|
||||||
include(xo_macros/code-coverage)
|
|
||||||
#include(cmake/cxx.cmake)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# unit test setup
|
# unit test setup
|
||||||
|
|
|
||||||
12
cmake/xo-bootstrap-macros.cmake
Normal file
12
cmake/xo-bootstrap-macros.cmake
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
if (("${CMAKE_MODULE_PATH}" STREQUAL "") OR ("${CMAKE_MODULE_PATH}" STREQUAL "prefix"))
|
||||||
|
# default to typical install location for xo-project-macros
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message("-- CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
||||||
|
message("-- CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}")
|
||||||
|
|
||||||
|
# needs to have been installed somewhere on CMAKE_MODULE_PATH,
|
||||||
|
# (e.g. from xo-cmake with the same value for CMAKE_INSTALL_PREFIX)
|
||||||
|
#
|
||||||
|
include(xo_macros/xo-project-macros)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue