diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 2ab628be..94a9cb27 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -247,6 +247,9 @@ endmacro() macro(xo_include_options2 target) xo_establish_submodule_build() + string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) + string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + #message("xo_include_options2: XO_SUBMODULE_BUILD=${XO_SUBMODULE_BUILD}") # ---------------------------------------------------------------- @@ -262,12 +265,12 @@ macro(xo_include_options2 target) target_include_directories( ${target} PUBLIC $ - $ - $ # e.g. for #include "indentlog/scope.hpp" - #$ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] - $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect - #$ # e.g. for generated .hpp files - $ # e.g. for generated .hpp files + $ + $ # e.g. for #include "indentlog/scope.hpp" + #$ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] + $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect + #$ # e.g. for generated .hpp files + $ # e.g. for generated .hpp files ) # ---------------------------------------------------------------- @@ -761,11 +764,14 @@ endmacro() # 2. pyfoo/pyfoo.hpp.in -> pyfoo/pyfoo.hpp # macro(xo_pybind11_library target projectTargets source_files) - file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/xo/${target}) + string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) + string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/xo/${_nxo_target}) configure_file( - ${target}.hpp.in - ${PROJECT_BINARY_DIR}/include/xo/${target}/${target}.hpp) + ${_nxo_target}.hpp.in + ${PROJECT_BINARY_DIR}/include/xo/${_nxo_target}/${_nxo_target}.hpp) # was ${PROJECT_SOURCE_DIR}/include/xo/${target}/${target}.hpp) xo_establish_symlink_install() @@ -774,12 +780,12 @@ macro(xo_pybind11_library target projectTargets source_files) xo_install_make_symlink( ${PROJECT_BINARY_DIR}/include/xo ${CMAKE_INSTALL_PREFIX}/include/xo - ${target}) + ${_nxo_target}) else() install( - FILES ${PROJECT_BINARY_DIR}/include/xo/${target}/${target}.hpp + FILES ${PROJECT_BINARY_DIR}/include/xo/${_nxo_target}/${_nxo_target}.hpp PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${target}) + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/xo/${_nxo_target}) endif() # find_package(Python..) finds python in