Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

cmake: Conditionally add log and log_setup to exported configuration #51

Merged
merged 2 commits into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/ome/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ if(OME_HAVE_BOOST_LOG)
set(log_libraries
Boost::log_setup
Boost::log)
set(OME_COMMON_OPTIONAL_BOOST_COMPONENTS "log_setup log")
endif()

target_link_libraries(ome-common
Expand Down
10 changes: 5 additions & 5 deletions lib/ome/common/OMECommonConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(OMECompat REQUIRED)
find_dependency(Boost 1.46 REQUIRED
find_dependency(OMECompat)
find_dependency(Boost 1.46
COMPONENTS date_time filesystem system iostreams
program_options regex)
find_dependency(XercesC 3.0.0 REQUIRED)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the drop of the REQUIRED qualifier required for the conditional import to work or is this related to the find_dependency limitations discussed in ome/ome-files-cpp#85 (comment)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unrelated to both. It's always been incorrect to use REQUIRED with find_dependency, but I didn't understand this at the time these files were written. find_dependency adds REQUIRED for you if the top-level find_package call used REQUIRED otherwise it's not added and left optional. It will work without the change, but the behaviour will be wrong.

find_dependency(XalanC 1.10 REQUIRED)
program_options regex @OME_COMMON_OPTIONAL_BOOST_COMPONENTS@)
find_dependency(XercesC 3.0.0)
find_dependency(XalanC 1.10)

include("${CMAKE_CURRENT_LIST_DIR}/OMECommonInternal.cmake")

Expand Down