This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
forked from badaix/popl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·68 lines (49 loc) · 1.93 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# ____ __ ____ __
# ( _ \ / \( _ \( )
# ) __/( O )) __// (_/\
# (__) \__/(__) \____/
# This file is part of popl (program options parser lib)
# Copyright (C) 2015-2021 Johannes Pohl
# Copyright (C) 2022 Andrea Ballestrazzi
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
cmake_minimum_required(VERSION 3.18)
set(PROJECT_VERSION "1.3.0")
project(popl_example)
# ================ COMPILATION CONFIGURATIONS ================
# This is required as some compilers don't support concepts
# automatically (like g++).
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message("[INFO] => Compiling with: -fconcepts.")
add_compile_options(-fconcepts)
endif()
if(NOT MSVC)
message("[INFO] => Adding -g option.")
# With clang or gcc we need this option in order to debug the
# project.
add_compile_options(-g)
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
# ============================================================
set(PROJECT_DESCRIPTION "Header-only C++ program options parser library")
set(PROJECT_URL "https://github.com/WinterWind33/popl20")
option(BUILD_EXAMPLE "Build example (build popl_example demo)" ON)
option(BUILD_TESTS "Build tests" ON)
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
SET(CMAKE_INSTALL_INCLUDEDIR include CACHE
PATH "Output directory for header files")
endif()
install(FILES include/popl.hpp DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
if (BUILD_EXAMPLE)
add_subdirectory(example)
endif (BUILD_EXAMPLE)
if (BUILD_TESTS)
option(USE_CATCH2_AS_TESTING_FRAMEWORK "Use Catch2 as testing framework" ON)
# Here we need to create the bin directory here because this
# will otherwise exists only after a succesfull operation. If we
# put the configuration file now without the bin directory,
# there will be an error.
file(MAKE_DIRECTORY "./bin/")
add_subdirectory(test)
endif (BUILD_TESTS)