-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
41 lines (33 loc) · 1.13 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
cmake_minimum_required(VERSION 3.18)
project(glsl-editor VERSION 1.0.0 LANGUAGES CXX)
if(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
message(FATAL "Binary dir cannot be the same as source dir")
endif()
if(MSVC)
add_executable(glsl-editor WIN32)
else()
add_executable(glsl-editor)
endif()
if(WIN32)
message("Including windows application manifest to glsl-editor.exe")
set_source_files_properties(resource.rc PROPERTIES LANGUAGE RC)
target_sources(glsl-editor PRIVATE resource.rc)
endif()
set_target_properties(glsl-editor
PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_STANDARD 20
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake"
)
# check if OpenGl is available
find_package(OpenGL REQUIRED)
add_subdirectory(3rdparty)
add_subdirectory(src)
# copy resources to the build folder
add_custom_command(TARGET glsl-editor PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/resources/ $<TARGET_FILE_DIR:glsl-editor>/resources
)