Skip to content

Commit

Permalink
Latest CPM and deps. Use and produce ALIAS CMake targets
Browse files Browse the repository at this point in the history
  • Loading branch information
iboB committed Sep 25, 2022
1 parent f0635ef commit 0b55419
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include(./get_cpm.cmake)

#######################################
# cmake lib
CPMAddPackage(gh:iboB/icm@1.3.3)
CPMAddPackage(gh:iboB/icm@1.3.4)

set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
Expand All @@ -30,12 +30,12 @@ option(JALOG_BUILD_EXAMPLES "jalog: build examples" ${ICM_DEV_MODE})

#######################################
# packages
CPMAddPackage(gh:iboB/splat@1.2.0)
CPMAddPackage(gh:iboB/itlib@1.6.2)
CPMAddPackage(gh:iboB/mscharconv@1.2.0)
CPMAddPackage(gh:iboB/splat@1.2.1)
CPMAddPackage(gh:iboB/itlib@1.6.3)
CPMAddPackage(gh:iboB/mscharconv@1.2.1)

if(NOT JALOG_NO_BUILTIN_ASYNC)
CPMAddPackage(gh:iboB/xec@1.4.0)
CPMAddPackage(gh:iboB/xec@1.4.1)
endif()

#######################################
Expand Down
7 changes: 4 additions & 3 deletions code/jalog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ icm_add_lib(jalog JALOG

${asyncSources}
)
add_library(jalog::jalog ALIAS jalog)

target_include_directories(jalog INTERFACE ..)
target_link_libraries(jalog
PUBLIC
splat
itlib
splat::splat
itlib::itlib
PRIVATE
mscharconv
msstl::charconv
)

if(JALOG_NO_BUILTIN_ASYNC)
Expand Down
2 changes: 1 addition & 1 deletion ext/jalog/sinks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ icm_add_lib(jalog-sinklib JALOG_SINKLIB
WindowsColorSink.hpp
WindowsColorSink.cpp
)

add_library(jalog::sinklib ALIAS jalog-sinklib)
target_include_directories(jalog-sinklib INTERFACE ../..)
target_link_libraries(jalog-sinklib PUBLIC jalog)
6 changes: 3 additions & 3 deletions get_cpm.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
set(CPM_DOWNLOAD_VERSION 0.34.3)
set(CPM_DOWNLOAD_VERSION 0.35.6)

if(CPM_SOURCE_CACHE)
# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()

# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
file(DOWNLOAD
Expand Down
12 changes: 6 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
#
include(icm_testing)

CPMAddPackage(gh:iboB/doctest-lib@2.4.8a)
CPMAddPackage(gh:iboB/doctest-util@0.0.5)

icm_add_test(
NAME jalog-qwrite
TARGET test-jalog-qwrite
LIBRARIES
doctest-main
itlib
splat
mscharconv
doctest::main
itlib::itlib
splat::splat
msstl::charconv
SOURCES t-qwrite.cpp
)

macro(jalog_test test)
icm_add_doctest_lib_test(${test} jalog ${ARGN})
add_doctest_lib_test(${test} jalog ${ARGN})
endmacro()

jalog_test(core t-core.cpp)
Expand Down

0 comments on commit 0b55419

Please sign in to comment.