From 5b3f712e0fb01151c7b36038faee1a94652ef672 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 16:52:29 -0400 Subject: [PATCH 1/6] build: + symlink-centric install --- CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7e32668..b5894f9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,15 +50,16 @@ xo_toplevel_compile_options() # ---------------------------------------------------------------- # output targets -set(SELF_LIB xo_pyutil) -add_library(${SELF_LIB} INTERFACE) -xo_include_headeronly_options2(${SELF_LIB}) +set(SELF_SHORTNAME pyutil) +set(SELF_LIB xo_${SELF_SHORTNAME}) +xo_add_headeronly_library(${SELF_LIB}) +#xo_include_headeronly_options2(${SELF_LIB}) # ---------------------------------------------------------------- # standard install + provide find_package() support -xo_install_library2(${SELF_LIB}) -xo_install_include_tree() +xo_install_library5(${SELF_LIB} ${SELF_SHORTNAME} ${PROJECT_NAME}Targets) +#xo_install_include_tree() xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets) # ---------------------------------------------------------------- From e548a3e8ed063767d36d095a527620082421e94b Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 14:56:52 -0400 Subject: [PATCH 2/6] build: handle cmake target called xo_pyutil instead of pyutil --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5894f9a..f85dd952 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ xo_toplevel_compile_options() set(SELF_SHORTNAME pyutil) set(SELF_LIB xo_${SELF_SHORTNAME}) -xo_add_headeronly_library(${SELF_LIB}) +xo_add_headeronly_library5(${SELF_LIB} ${SELF_SHORTNAME}) #xo_include_headeronly_options2(${SELF_LIB}) # ---------------------------------------------------------------- From 6f1b0aca760a719a173fe4a60ba97c8c798cd8e5 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 17:27:05 -0400 Subject: [PATCH 3/6] build: use streamlined xo-cmake api --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f85dd952..b5894f9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ xo_toplevel_compile_options() set(SELF_SHORTNAME pyutil) set(SELF_LIB xo_${SELF_SHORTNAME}) -xo_add_headeronly_library5(${SELF_LIB} ${SELF_SHORTNAME}) +xo_add_headeronly_library(${SELF_LIB}) #xo_include_headeronly_options2(${SELF_LIB}) # ---------------------------------------------------------------- From f880bc66598db2b9fcb57cd6ca3c0b67edd561a6 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 17:37:10 -0400 Subject: [PATCH 4/6] build: simplify cmake macro api --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5894f9a..8b8e6720 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,15 +50,14 @@ xo_toplevel_compile_options() # ---------------------------------------------------------------- # output targets -set(SELF_SHORTNAME pyutil) -set(SELF_LIB xo_${SELF_SHORTNAME}) +set(SELF_LIB xo_pyutil) xo_add_headeronly_library(${SELF_LIB}) #xo_include_headeronly_options2(${SELF_LIB}) # ---------------------------------------------------------------- # standard install + provide find_package() support -xo_install_library5(${SELF_LIB} ${SELF_SHORTNAME} ${PROJECT_NAME}Targets) +xo_install_library4(${SELF_LIB} ${PROJECT_NAME}Targets) #xo_install_include_tree() xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets) From f81b6abda80a87693494378c4936a8bc977c7b68 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 15 Mar 2024 19:29:24 -0400 Subject: [PATCH 5/6] build: streamline CMAKE_MODULE_PATH interaction --- .gitignore | 9 ++++++--- CMakeLists.txt | 3 +-- cmake/xo-bootstrap-macros.cmake | 12 ++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 cmake/xo-bootstrap-macros.cmake diff --git a/.gitignore b/.gitignore index 49f711e2..13c0afb7 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b8e6720..e412e4a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/cmake/xo-bootstrap-macros.cmake b/cmake/xo-bootstrap-macros.cmake new file mode 100644 index 00000000..16644435 --- /dev/null +++ b/cmake/xo-bootstrap-macros.cmake @@ -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) From c8947337066160bb5be3544f995e9be6395cf496 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 29 Mar 2024 14:33:41 -0400 Subject: [PATCH 6/6] build: suppress bootstrap message in submodule build --- cmake/xo-bootstrap-macros.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/xo-bootstrap-macros.cmake b/cmake/xo-bootstrap-macros.cmake index 16644435..96592216 100644 --- a/cmake/xo-bootstrap-macros.cmake +++ b/cmake/xo-bootstrap-macros.cmake @@ -3,8 +3,10 @@ if (("${CMAKE_MODULE_PATH}" STREQUAL "") OR ("${CMAKE_MODULE_PATH}" STREQUAL "pr set(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake) endif() -message("-- CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") -message("-- CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}") +if (NOT XO_SUBMODULE_BUILD) + message("-- CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + message("-- CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}") +endif() # needs to have been installed somewhere on CMAKE_MODULE_PATH, # (e.g. from xo-cmake with the same value for CMAKE_INSTALL_PREFIX)