-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (42 loc) · 1.63 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
cmake_minimum_required(VERSION 3.3)
find_package(OpenGL)
find_package(BISON)
find_package(FLEX)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
bison_target(WyattParser src/lang/parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.hpp)
flex_target(WyattLexer src/lang/scanner.l ${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp COMPILE_FLAGS "--nounistd")
add_flex_bison_dependency(WyattLexer WyattParser)
set(SOURCES src/main.cpp
src/lang/glsltranspiler.cpp
src/lang/helper.cpp
src/lang/interpreter.cpp
src/lang/scope.cpp
src/lang/scopelist.cpp
src/ui/codeeditor.cpp
src/ui/customglwidget.cpp
src/ui/highlighter.cpp
src/ui/logwindow.cpp
src/ui/mainwindow.cpp
${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp
${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS})
set(LIBS ${LIBS} ${OPENGL_LIBRARY})
include_directories(${INCLUDE_DIRS})
include_directories(${QT_INCLUDES})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(src/lang)
include_directories(src/ui)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(wyatt ${SOURCES} ${BISON_WyattParser_OUPUTS} ${FLEX_WyattLexer_OUTPUTS} )
target_link_libraries(wyatt ${LIBS})
qt5_use_modules(wyatt Core Gui Widgets)
if(WIN32)
find_program(WINDEPLOYQT_EXECUTABLE NAMES windeployqt HINTS ${QTDIR} ENV QTDIR PATH_SUFFIXES bin)
add_custom_command(TARGET wyatt POST_BUILD
COMMAND ${WINDEPLOYQT_EXECUTABLE} --release $<TARGET_FILE:wyatt>)
endif()