-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
35 lines (28 loc) · 1017 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
35 lines (28 loc) · 1017 Bytes
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.0.0)
project(Mesh2D)
# c++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
#add_compile_options(-Wall -Wextra -pedantic -Werror)
add_compile_options(-DOUTPUTEXP)
# header and src files
include_directories(include)
file(GLOB CADSOURCE "CAD3D/*.cpp")
ADD_CUSTOM_TARGET(debug
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target all
COMMENT "Switch CMAKE_BUILD_TYPE to Debug"
)
ADD_CUSTOM_TARGET(release
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target all
COMMENT "Switch CMAKE_BUILD_TYPE to Release"
)
# build shared library
add_library(LIBPROCESSING SHARED ${CADSOURCE})
# process executable
add_executable(mesh mesh.cpp)
target_link_libraries(mesh LIBPROCESSING)
# process executable
add_executable(Fix3DMesh Fix3DMesh.cpp)
target_link_libraries(Fix3DMesh LIBPROCESSING)