-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
87 lines (66 loc) · 2.47 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
cmake_minimum_required(VERSION 2.8.12)
####################################################
# Project Properties
####################################################
project("Sketch"
DESCRIPTION "A 2D CAD application using OpenGL 3.0 & ImGui"
LANGUAGES CXX
)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
option(ENABLE_DEBUG "Enable debug mode" ON)
####################################################
# Include Source File Directories
####################################################
set(DIRS "")
####################################################
# Create List of Source Files
####################################################
## Add Source Files from the main directory
file(GLOB SRC_FILES *.c *.cpp *.h *.hpp)
## Add Source Files from the other directories
foreach(DIR ${DIRS})
# Find all source files & append to list
file(GLOB SRC_FILES_IN_FOLDER ${DIR}/*.c ${DIR}/*.cpp ${DIR}/*.h ${DIR}/*.hpp)
list(APPEND SRC_FILES ${SRC_FILES_IN_FOLDER})
endforeach()
## Show the files being added & put each file on it's own line
if(1)
message(STATUS "Compling Project '${PROJECT_NAME}'")
message(STATUS "Source Files:")
foreach(SRC_FILE ${SRC_FILES})
message(${SRC_FILE})
endforeach()
endif()
####################################################
# Build Target
####################################################
## Build target with source files
#~ add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
add_executable(${PROJECT_NAME} ${SRC_FILES})
####################################################
# Include Librarys
####################################################
## Include Library from cmakefile
add_subdirectory(deps/GLViewer)
add_subdirectory(deps/constraintsolver)
add_subdirectory(deps/Geos)
# link libraries
target_link_libraries(${PROJECT_NAME}
MaxLib
GLViewer
ConstraintSolver
Geos
)
####################################################
# Set Compiler Options
####################################################
set(DEBUG_COMPILE_OPTIONS -Wall -Wextra -Wpedantic -Wno-psabi)
if (ENABLE_DEBUG)
message(STATUS "Debug Mode Enabled for '${PROJECT_NAME}'")
list(APPEND DEBUG_COMPILE_OPTIONS -g)
endif ()
target_compile_options(${PROJECT_NAME} PRIVATE ${DEBUG_COMPILE_OPTIONS})
####################################################