-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
35 lines (28 loc) · 1.31 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
cmake_minimum_required(VERSION 3.9)
project(NGP C)
set(EXEC lmeca2710_project) # put whatever name you want for the executable
file(GLOB_RECURSE sources "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c")
add_executable(${EXEC}
"${CMAKE_CURRENT_SOURCE_DIR}/src/main.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/inputs.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/delaunay.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/predicates.c"
# you can add other source file here !
)
target_include_directories(${EXEC} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src")
set_target_properties(${EXEC} PROPERTIES
C_STANDARD 99
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
add_subdirectory(deps/BOV)
target_link_libraries(${EXEC} bov)
# set ${EXEC} as the startup project in visual studio
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${EXEC})
# Add -O0 to remove optimizations when using gcc
IF(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O3")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O3")
SET(CMAKE_CXX_FLAGS "-O3")
SET(CMAKE_C_FLAGS "-O3")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
# Uncomment to add debugging information for valgrind
#set(CMAKE_BUILD_TYPE Debug)