Compatible with lower cmake version.

This commit is contained in:
luocai 2023-12-27 19:42:12 +08:00
parent e68f8d5a3a
commit ad2c3e2881
2 changed files with 6 additions and 18 deletions

View File

@ -1,20 +1,3 @@
cmake_minimum_required(VERSION 3.27)
project(DataStructure)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(Projects_ROOT E:/Projects)
set(Libraries_ROOT ${Projects_ROOT}/Libraries)
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_83_0_msvc2022_64bit)
set(Boost_INCLUDE_DIR ${BOOST_ROOT}/include/boost-1_83)
option(Boost_USE_STATIC_LIBS OFF)
add_compile_definitions(
BOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN10
)
add_library(DataStructure
Array.h
ArrayList.h

View File

@ -14,11 +14,16 @@ add_library(Universal
StringUtility.h StringUtility.cpp
)
if(CMAKE_VERSION VERSION_LESS 3.20)
get_filename_component(KYLIN_CORE_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
else()
cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH KYLIN_CORE_INCLUDE_PATH)
endif()
target_include_directories(Universal
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
INTERFACE ${KYLIN_CORE_INCLUDE_PATH}
PUBLIC ${Boost_INCLUDE_DIRS}
)
target_link_libraries(Universal