Add CMake build configuration
This commit is contained in:
1 parent
cfcacee550
commit
2535953b8b
1 file changed
+33
@@ -0,0 +1,33 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(kindle2latex LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
function(kindle2latex_enable_warnings target)
|
||||
if(MSVC)
|
||||
target_compile_options(${target} PRIVATE /W4)
|
||||
else()
|
||||
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_executable(kindle2latex_typefactory
|
||||
typefactory/main.cpp
|
||||
typefactory/typefactory.h
|
||||
)
|
||||
set_target_properties(kindle2latex_typefactory PROPERTIES
|
||||
OUTPUT_NAME kindle2latex-typefactory
|
||||
)
|
||||
kindle2latex_enable_warnings(kindle2latex_typefactory)
|
||||
|
||||
add_executable(kindle2latex_fsm
|
||||
fsm/main.cpp
|
||||
fsm/fsm.h
|
||||
)
|
||||
set_target_properties(kindle2latex_fsm PROPERTIES
|
||||
OUTPUT_NAME kindle2latex-fsm
|
||||
)
|
||||
kindle2latex_enable_warnings(kindle2latex_fsm)
|
||||
Reference in new issue
Block a user