~riderius/cpp-code

cpp-code/CMakeLists.txt -rw-r--r-- 1.6 KiB
380d65aariderius digits_analysis.cpp: argv[1] can replace n 11 days ago
                                                                                
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
cmake_minimum_required(VERSION 3.5)
project(cpp_code)

set(CMAKE_CXX_STANDARD 17)
SET(MYCOMPILE_FLAGS "-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -O2")
message(INFO " COMPILE_FLAGS: " ${MYCOMPILE_FLAGS})
add_definitions(${MYCOMPILE_FLAGS})

# Simple progs

add_executable(Celsius_to_Fahrenheit_converter Celsius_to_Fahrenheit_converter.cpp)
add_executable(Light_years_to_Astronomical_Units_Converter Light_years_to_Astronomical_Units_Converter.cpp)
add_executable(decimal2binary decimal2binary.cpp)
add_executable(digits_analysis digits_analysis.cpp)
add_executable(digit_or_letter digit_or_letter.cpp)
add_executable(fib fibonacci.cpp)
add_executable(reverse_int reverse_int.cpp)
add_executable(guess_the_number guess_the_number.cpp)
add_executable(codetime codetime.cpp)
add_executable(Mstat math_stat.cpp)
add_executable(sqrt sqrt.cpp)

# Curses progs

set(CURSES_NEED_NCURSES, TRUE)
set(CURSES_NEED_WIDE, TRUE)
find_package(Curses)
if(CURSES_FOUND)
    include_directories(${CURSES_INCLUDE_DIRS})
    add_executable(screensaver screensaver.cpp)
    add_executable(keylog keylog.cpp)
    target_link_libraries(screensaver ${CURSES_LIBRARY})
    target_link_libraries(keylog ${CURSES_LIBRARY})
else()
    message(WARNING "Failed to find ncursesw. Curses programs do not compile.")
endif()