Skip to content

Commit

Permalink
Merge branch 'develop' into feature/version-header
Browse files Browse the repository at this point in the history
  • Loading branch information
liss-h committed Jul 22, 2024
2 parents 3f8ce2d + d4b6a65 commit 841b2b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.hpp.in ${CMAKE_CURRENT_

option(BUILD_TESTING "Build tests" OFF)

if (PROJECT_IS_TOP_LEVEL)
if (BUILD_TESTING)
set(CONAN_INSTALL_ARGS "${CONAN_INSTALL_ARGS};-o=&:with_test_deps=True")
endif ()
endif ()

add_library(${PROJECT_NAME} INTERFACE)
# Use dice::sparse_map as target, more consistent with other libraries conventions (Boost, Qt, ...)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
Expand Down
9 changes: 8 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@ class Recipe(ConanFile):
package_type = "header-library"
generators = "CMakeDeps", "CMakeToolchain"
no_copy_source = True
options = {
"with_test_deps": [True, False],
}
default_options = {
"with_test_deps": False,
}

def requirements(self):
self.test_requires("boost/1.83.0")
if self.options.with_test_deps:
self.test_requires("boost/1.83.0")

def set_name(self):
if not hasattr(self, 'name') or self.version is None:
Expand Down

0 comments on commit 841b2b0

Please sign in to comment.