mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-13 01:10:26 +08:00
Merge pull request #635 from DanielChabrowski/cmake_explicit_lang
CMake explicit language
This commit is contained in:
commit
8cfd71a9be
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1)
|
cmake_minimum_required(VERSION 3.1)
|
||||||
project(spdlog VERSION 0.16.3)
|
project(spdlog VERSION 0.16.3 LANGUAGES CXX)
|
||||||
include(CTest)
|
include(CTest)
|
||||||
include(CMakeDependentOption)
|
include(CMakeDependentOption)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
@ -73,7 +73,6 @@ configure_file("cmake/spdlog.pc.in" "${pkg_config}" @ONLY)
|
|||||||
install(
|
install(
|
||||||
TARGETS spdlog
|
TARGETS spdlog
|
||||||
EXPORT "${targets_export_name}"
|
EXPORT "${targets_export_name}"
|
||||||
INCLUDES DESTINATION "${include_install_dir}"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# install headers
|
# install headers
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
# *************************************************************************/
|
# *************************************************************************/
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.1)
|
||||||
project(SpdlogExamples)
|
project(SpdlogExamples CXX)
|
||||||
|
|
||||||
if(TARGET spdlog)
|
if(TARGET spdlog)
|
||||||
# Part of the main project
|
# Part of the main project
|
||||||
@ -32,16 +32,16 @@ else()
|
|||||||
find_package(spdlog CONFIG REQUIRED)
|
find_package(spdlog CONFIG REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Threads)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
add_executable(example example.cpp)
|
add_executable(example example.cpp)
|
||||||
target_link_libraries(example spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(example spdlog::spdlog Threads::Threads)
|
||||||
|
|
||||||
add_executable(benchmark bench.cpp)
|
add_executable(benchmark bench.cpp)
|
||||||
target_link_libraries(benchmark spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(benchmark spdlog::spdlog Threads::Threads)
|
||||||
|
|
||||||
add_executable(multisink multisink.cpp)
|
add_executable(multisink multisink.cpp)
|
||||||
target_link_libraries(multisink spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(multisink spdlog::spdlog Threads::Threads)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
project(spdlog-utests)
|
project(spdlog-utests CXX)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
Loading…
Reference in New Issue
Block a user