Skip to content
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ project (seqan3
DESCRIPTION "SeqAn3 -- the modern C++ library for sequence analysis"
HOMEPAGE_URL "https://github.com/seqan/seqan3")

find_package (SeqAn3 3.0 REQUIRED HINTS ${SEQAN3_MODULE_PATH})
include (seqan3-config)

option (INSTALL_SEQAN3 "Enable installation of seqan3. (Projects embedding seqan3 may want to turn this OFF.)" ON)

Expand Down
42 changes: 23 additions & 19 deletions cmake/seqan3-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -281,24 +281,28 @@ endif ()
# Finish find_package call
# ----------------------------------------------------------------------------

find_package_handle_standard_args (${CMAKE_FIND_PACKAGE_NAME} REQUIRED_VARS SEQAN3_INCLUDE_DIR)

# Set SEQAN3_* variables with the content of ${CMAKE_FIND_PACKAGE_NAME}_(FOUND|...|VERSION)
# This needs to be done, because `find_package(SeqAn3)` might be called in any case-sensitive way and we want to
# guarantee that SEQAN3_* are always set.
foreach (package_var
FOUND
DIR
ROOT
CONFIG
VERSION
VERSION_MAJOR
VERSION_MINOR
VERSION_PATCH
VERSION_TWEAK
VERSION_COUNT)
set (SEQAN3_${package_var} "${${CMAKE_FIND_PACKAGE_NAME}_${package_var}}")
endforeach ()
if (CMAKE_FIND_PACKAGE_NAME)
find_package_handle_standard_args (${CMAKE_FIND_PACKAGE_NAME} REQUIRED_VARS SEQAN3_INCLUDE_DIR)

# Set SEQAN3_* variables with the content of ${CMAKE_FIND_PACKAGE_NAME}_(FOUND|...|VERSION)
# This needs to be done, because `find_package(SeqAn3)` might be called in any case-sensitive way and we want to
# guarantee that SEQAN3_* are always set.
foreach (package_var
FOUND
DIR
ROOT
CONFIG
VERSION
VERSION_MAJOR
VERSION_MINOR
VERSION_PATCH
VERSION_TWEAK
VERSION_COUNT)
set (SEQAN3_${package_var} "${${CMAKE_FIND_PACKAGE_NAME}_${package_var}}")
endforeach ()
else ()
set (SEQAN3_VERSION "${PACKAGE_VERSION}")
endif ()

# propagate SEQAN3_INCLUDE_DIR into SEQAN3_INCLUDE_DIRS
set (SEQAN3_INCLUDE_DIRS ${SEQAN3_INCLUDE_DIR})
Expand All @@ -307,7 +311,7 @@ set (SEQAN3_INCLUDE_DIRS ${SEQAN3_INCLUDE_DIR})
# Export targets
# ----------------------------------------------------------------------------

if (SEQAN3_FOUND AND NOT TARGET seqan3::seqan3)
if (NOT TARGET seqan3::seqan3)
add_library (seqan3_seqan3 INTERFACE)
target_compile_definitions (seqan3_seqan3 INTERFACE ${SEQAN3_DEFINITIONS})
target_compile_features (seqan3_seqan3 INTERFACE cxx_std_23)
Expand Down