-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
43 lines (37 loc) · 1.52 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
#
# gmsh-reader
# (c)2020 Applied Scientific Research, Inc.
#
CMAKE_MINIMUM_REQUIRED( VERSION 3.5 )
PROJECT( gmsh-reader CXX )
# User-serviceable variables here
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo")
IF (NOT CMAKE_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE "Release")
ENDIF ()
SET (CMAKE_VERBOSE_MAKEFILE on)
SET (CMAKE_EXPORT_COMPILE_COMMANDS on)
# Define compiler-specific options
IF (CMAKE_COMPILER_IS_GNUCXX)
SET (CMAKE_CXX_FLAGS "-Wall -Wformat -std=c++17 -Wno-int-in-bool-context")
SET (CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb3")
SET (CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -march=native -g -ggdb3")
ELSEIF (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
SET (CMAKE_CXX_FLAGS "-Wall -Wformat -std=c++17")
SET (CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb")
SET (CMAKE_CXX_FLAGS_RELEASE "-O3")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -ggdb")
ELSEIF (MSVC)
SET (CMAKE_CXX_FLAGS "/std:c++17 /EHsc /D_USE_MATH_DEFINES /DNOMINMAX")
SET (CMAKE_CXX_FLAGS_DEBUG "/Zi")
SET (CMAKE_CXX_FLAGS_RELEASE "/O2")
ENDIF ()
INCLUDE_DIRECTORIES( "src" )
# Define targets
ADD_LIBRARY ( "${PROJECT_NAME}" STATIC "src/read_MSH_Mesh.cpp" )
#ADD_LIBRARY ( ${PROJECT_NAME} SHARED "src/read_MSH_Mesh.cpp" )
#TARGET_INCLUDE_DIRECTORIES( "${PROJECT_NAME}" PUBLIC ${PROJECT_SOURCE_DIR} )
TARGET_INCLUDE_DIRECTORIES( "${PROJECT_NAME}" PUBLIC "src" )
ADD_EXECUTABLE( "${PROJECT_NAME}.bin" "src/main.cpp" )
TARGET_LINK_LIBRARIES( "${PROJECT_NAME}.bin" LINK_PUBLIC "${PROJECT_NAME}" )