-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
54 lines (44 loc) · 1.12 KB
/
CMakeLists.txt
File metadata and controls
54 lines (44 loc) · 1.12 KB
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
cmake_minimum_required(VERSION 3.12)
project(iodd_parser)
# Set C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Debug mode option
option(ENABLE_DEBUG "Enable debug mode" OFF)
# Set output directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Configure debug definitions
if(ENABLE_DEBUG)
add_definitions(-DDEBUG_MODE)
set(CMAKE_BUILD_TYPE Debug)
message(STATUS "Debug mode enabled")
else()
set(CMAKE_BUILD_TYPE Release)
message(STATUS "Debug mode disabled")
endif()
# Collect source files
file(GLOB_RECURSE SOURCES
"src/*.cpp"
"src/*.c"
)
# Include directories
include_directories(${PROJECT_SOURCE_DIR}/inc)
# Create executable
add_executable(${PROJECT_NAME}
${SOURCES}
main.cpp
)
# Compiler warnings
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall
-Wextra
-Wpedantic
-Wno-sign-compare
)
# Install rules
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
)
# Copy IODD files to build directory
file(COPY ${CMAKE_SOURCE_DIR}/ioddfiles DESTINATION ${CMAKE_BINARY_DIR})