mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 03:55:29 +00:00
Implement #278 in another way based on https://github.com/tinfoilboy/CTML/blob/master/CMakeLists.txt
.
This commit is contained in:
parent
dc1a054cf2
commit
b6ceab2554
@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(cpp-peglib)
|
||||
project(peglib)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
@ -10,8 +10,6 @@ else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
|
||||
endif()
|
||||
|
||||
option(BUILD_TESTS "Build cpp-peglib tests" ON)
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads)
|
||||
|
||||
@ -19,14 +17,24 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(add_link_deps Threads::Threads)
|
||||
endif()
|
||||
|
||||
add_subdirectory(lint)
|
||||
add_library(peglib INTERFACE)
|
||||
target_include_directories(peglib INTERFACE ${CMAKE_SOURCE_DIR})
|
||||
|
||||
add_subdirectory(example)
|
||||
# add_subdirectory(cymbol)
|
||||
option(BUILD_TESTS "Build cpp-peglib tests" ON)
|
||||
option(PEGLIB_BUILD_LINT "Build cpp-peglib lint utility" OFF)
|
||||
option(PEGLIB_BUILD_EXAMPLES "Build cpp-peglib examples" OFF)
|
||||
|
||||
if (${BUILD_TESTS})
|
||||
add_subdirectory(test)
|
||||
enable_testing()
|
||||
endif()
|
||||
|
||||
if (${PEGLIB_BUILD_LINT})
|
||||
add_subdirectory(lint)
|
||||
endif()
|
||||
|
||||
if (${PEGLIB_BUILD_EXAMPLES})
|
||||
add_subdirectory(example)
|
||||
endif()
|
||||
|
||||
install(FILES peglib.h DESTINATION include)
|
||||
|
Loading…
Reference in New Issue
Block a user