build: streamline CMAKE_MODULE_PATH interaction

This commit is contained in:
Roland Conybeare 2024-03-15 19:38:10 -04:00
commit 69d30651cc
4 changed files with 14 additions and 6 deletions

3
.gitignore vendored
View file

@ -1,7 +1,6 @@
# lsp keep state here
.cache
# typical build directories
build
ccov
.build*
# for lsp: manual symlink to chosen build directory
compile_commands.json

View file

@ -6,8 +6,7 @@ project(simulator VERSION 1.0)
enable_language(CXX)
# common XO cmake macros (see proj/xo-cmake)
include(xo_macros/xo_cxx)
include(xo_macros/code-coverage)
include(cmake/xo-bootstrap-macros.cmake)
# ----------------------------------------------------------------
# unit test setup

View 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)

View file

@ -15,5 +15,3 @@ xo_add_shared_library4(${SELF_LIB} ${PROJECT_NAME}Targets ${PROJECT_VERSION} 1 $
# in xo-simulator/cmake/simulatorConfig.cmake.in
#
xo_dependency(${SELF_LIB} reactor)
#xo_dependency(${SELF_LIB} webutil)
#xo_dependency(${SELF_LIB} callback)