build: streamline CMAKE_MODULE_PATH interaction
This commit is contained in:
parent
f880bc6659
commit
f81b6abda8
3 changed files with 19 additions and 5 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
|
@ -1,3 +1,6 @@
|
|||
# typical build directories
|
||||
build
|
||||
ccov
|
||||
# clangd working space (see emacs+lsp)
|
||||
.cache
|
||||
# typical cmake build directory (source-tree-nephew)
|
||||
.build*
|
||||
# symlink to builddir/compile_commands.json; should be set manually in dev sandbox
|
||||
compile_commands.json
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@ project(xo_pyutil VERSION 0.1)
|
|||
enable_language(CXX)
|
||||
|
||||
# common XO cmake macros (see github:Rconybea/xo-cmake)
|
||||
include(xo_macros/xo_cxx)
|
||||
include(xo_macros/code-coverage) # very little to unit test here
|
||||
include(cmake/xo-bootstrap-macros.cmake)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 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