-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
48 lines (39 loc) · 1.79 KB
/
CMakeLists.txt
File metadata and controls
48 lines (39 loc) · 1.79 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
CMAKE_MINIMUM_REQUIRED (VERSION 3.6)
project(IFCPP LANGUAGES CXX)
# Set a default build type if none was specified https://blog.kitware.com/cmake-and-the-default-build-type/
set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "------------------------------------------------------------------------")
option(BUILD_CONSOLE_APPLICATION "Build an example CLI application" ON)
if (WIN32)
option(BUILD_VIEWER_APPLICATION "Build the viewer example application" ON)
else(NOT WIN32)
option(BUILD_VIEWER_APPLICATION "Build the viewer example application" OFF)
endif()
option(USE_OSG_DEBUG "Use openscenegraph debug library" OFF)
IF(NOT WIN32)
IF("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
SET_PROPERTY(DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG>
)
ENDIF()
ENDIF()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
ELSE(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF(NOT WIN32)
ADD_SUBDIRECTORY (IfcPlusPlus)
IF(BUILD_CONSOLE_APPLICATION)
ADD_SUBDIRECTORY (examples/CreateIfcWallAndWriteFile)
ADD_SUBDIRECTORY (examples/LoadFileExample)
ENDIF()
IF(BUILD_VIEWER_APPLICATION)
ADD_SUBDIRECTORY (examples/SimpleViewerExampleQt)
ENDIF()