Skip to content

Commit

Permalink
Merge branch 'develop' into cleanup_issues_in_sensei_config
Browse files Browse the repository at this point in the history
  • Loading branch information
kwryankrattiger authored Nov 9, 2021
2 parents 795ceae + a45a612 commit 31c9166
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
1 change: 1 addition & 0 deletions CMake/external.pugixml.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find_package(pugixml REQUIRED COMPONENTS pugixml)
7 changes: 1 addition & 6 deletions utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ target_include_directories(opts
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/opts"
DESTINATION include)


if(SENSEI_USE_EXTERNAL_pugixml)
find_package(pugixml REQUIRED COMPONENTS pugixml)
else ()
add_subdirectory(pugixml)
endif()
add_subdirectory(pugixml)

#add_subdirectory(ImageTester)
35 changes: 23 additions & 12 deletions utils/pugixml/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
sensei_add_library(pugixml STATIC src/pugixml.cpp)
if (SENSEI_USE_EXTERNAL_pugixml)
find_package(pugixml REQUIRED COMPONENTS pugixml)

target_include_directories(pugixml
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include/pugixml>)

set_property(TARGET pugixml PROPERTY POSITION_INDEPENDENT_CODE ON)
configure_file("${CMAKE_SOURCE_DIR}/CMake/external.pugixml.cmake.in"
"${CMAKE_BINARY_DIR}/lib/cmake/pugixml.cmake"
@ONLY)

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/"
DESTINATION include/pugixml FILES_MATCHING PATTERN "*.hpp")
install(
FILES "${CMAKE_BINARY_DIR}/lib/cmake/pugixml.cmake"
DESTINATION "lib/cmake")
else ()
sensei_add_library(pugixml STATIC src/pugixml.cpp)

install(TARGETS pugixml EXPORT pugixml
INCLUDES DESTINATION include/pugixml ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
target_include_directories(pugixml
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include/pugixml>)

install(EXPORT pugixml DESTINATION lib/cmake
EXPORT_LINK_INTERFACE_LIBRARIES)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/"
DESTINATION include/pugixml FILES_MATCHING PATTERN "*.hpp")

install(TARGETS pugixml EXPORT pugixml
INCLUDES DESTINATION include/pugixml ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)

install(EXPORT pugixml DESTINATION lib/cmake
EXPORT_LINK_INTERFACE_LIBRARIES)
endif ()

0 comments on commit 31c9166

Please sign in to comment.