Skip to content
Open
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
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if(UNIX OR VXWORKS)
set(FOONATHAN_MEMORY_ARCHIVE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
set(FOONATHAN_MEMORY_FRAMEWORK_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")

set(FOONATHAN_MEMORY_CMAKE_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/foonathan_memory/cmake")
set(FOONATHAN_MEMORY_CMAKE_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/foonathan_memory")
set(FOONATHAN_MEMORY_ADDITIONAL_FILES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/foonathan_memory")
elseif(WIN32)
set(FOONATHAN_MEMORY_INC_INSTALL_DIR "include")
Expand All @@ -51,6 +51,8 @@ include(cmake/configuration.cmake)
include(cmake/atomic.cmake)
include(cmake/get_container_node_sizes.cmake)

option(FOONATHAN_MEMORY_USE_SYSTEM_DOCTEST "Use the system doctest library" OFF)

# subdirectories
add_subdirectory(src)
if(FOONATHAN_MEMORY_BUILD_EXAMPLES)
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ elseif(MSVC)
endif()

set_target_properties(foonathan_memory PROPERTIES
OUTPUT_NAME "foonathan_memory-$CACHE{FOONATHAN_MEMORY_VERSION}"
VERSION ${FOONATHAN_MEMORY_VERSION}
SOVERSION ${FOONATHAN_MEMORY_VERSION_MAJOR}
POSITION_INDEPENDENT_CODE ON)

if(NEED_LIBRARY_FOR_CXX_ATOMIC)
Expand Down
14 changes: 9 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ target_link_libraries(foonathan_memory_profiling foonathan_memory)
target_include_directories(foonathan_memory_profiling PRIVATE
${FOONATHAN_MEMORY_SOURCE_DIR}/include/foonathan/memory)

# Fetch doctest.
message(STATUS "Fetching doctest")
include(FetchContent)
FetchContent_Declare(doctest URL https://github.com/doctest/doctest/archive/refs/tags/v2.4.12.zip)
FetchContent_MakeAvailable(doctest)
if(FOONATHAN_MEMORY_USE_SYSTEM_DOCTEST)
find_package(doctest REQUIRED)
else()
# Fetch doctest.
message(STATUS "Fetching doctest")
include(FetchContent)
FetchContent_Declare(doctest URL https://github.com/doctest/doctest/archive/refs/tags/v2.4.12.zip)
FetchContent_MakeAvailable(doctest)
endif()

set(tests
test_allocator.hpp
Expand Down