forked from paceholder/nodeeditor
-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
70 lines (48 loc) · 1.79 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
cmake_minimum_required(VERSION 3.2)
# version 3.4 is required as other do not work with C++14 and clang
project(NodeEditor CXX)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
option(BUILD_EXAMPLES "Build Examples" ON)
# Find the QtWidgets library
find_package(Qt5 COMPONENTS
Core
Widgets
Gui
OpenGL)
add_definitions(${Qt5Widgets_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
IF (MSVC)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
ENDIF (MSVC)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#############################################################
file(GLOB_RECURSE LIB_CPPS ./src/*.cpp )
qt5_add_resources(RESOURCES ./resources/resources.qrc)
# Tell CMake to create the helloworld executable
add_library(chigraphnodes SHARED ${LIB_CPPS} ${RESOURCES})
target_include_directories(chigraphnodes INTERFACE "include")
target_compile_definitions(chigraphnodes PUBLIC "-DNODE_EDITOR_SHARED")
target_compile_definitions(chigraphnodes PRIVATE "-DNODE_EDITOR_EXPORTS")
target_link_libraries(chigraphnodes
Qt5::Core
Qt5::Widgets
Qt5::Gui
Qt5::OpenGL)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
install(TARGETS chigraphnodes
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)