cpp-peglib/CMakeLists.txt

27 lines
546 B
CMake
Raw Normal View History

2021-08-19 06:29:11 +00:00
cmake_minimum_required(VERSION 3.14)
project(cpp-peglib)
2020-10-02 01:26:04 +00:00
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
2020-10-02 01:26:04 +00:00
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /utf-8")
2021-01-19 17:03:06 +00:00
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
endif()
2020-06-20 12:43:15 +00:00
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(add_link_deps Threads::Threads)
endif()
add_subdirectory(example)
2020-01-23 23:29:13 +00:00
add_subdirectory(lint)
2020-10-02 01:26:04 +00:00
add_subdirectory(test)
2021-08-17 23:13:31 +00:00
2020-10-02 01:26:04 +00:00
enable_testing()
install(FILES peglib.h DESTINATION include)