-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (28 loc) · 1.02 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
cmake_minimum_required (VERSION 3.18)
cmake_policy(VERSION 3.18)
project(bux)
set(GNU_LIKE_CXX_FLAGS " -Wall -Wextra -Wshadow -Wconversion -Wno-parentheses -std=c++23")
#string(APPEND GNU_LIKE_CXX_FLAGS " -ggdb")
string(APPEND GNU_LIKE_CXX_FLAGS " -O2")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT MSVC)
message("Clang")
string(APPEND CMAKE_CXX_FLAGS "${GNU_LIKE_CXX_FLAGS} -Wno-potentially-evaluated-expression")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message("GNU")
string(APPEND CMAKE_CXX_FLAGS "${GNU_LIKE_CXX_FLAGS}")
elseif(MSVC)
message("MSVC")
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus /std:c++latest /MP")
else()
message("Unknown compiler")
endif()
add_subdirectory (src)
if(${BUILD_TEST})
message("Build tests too")
add_subdirectory (test)
endif()
install(TARGETS bux
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/bux DESTINATION include) # in ${CMAKE_INSTALL_PREFIX}/include/bux