-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
84 lines (68 loc) · 1.78 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# CMakeList.txt : CMake project for CyanArgParser, include source and define
# project specific logic here.
#
cmake_minimum_required(VERSION 3.8)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
set(
CMAKE_CXX_STANDARD 20
)
set (HEADER
${HEADER}
${CMAKE_CURRENT_SOURCE_DIR}/include/CyanShaderLib/ShaderLoader.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/CyanShaderLib/ShaderSource.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/CyanShaderLib/ShaderProgram.hpp
)
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "library")
endif()
project(
"CyanShaderLib"
VERSION 1.0.0
DESCRIPTION "A simple C++17 GLSL shader library"
)
find_package(
GLEW REQUIRED
)
include_directories(
${PROJECT_NAME}
"include/"
)
add_library(${PROJECT_NAME} STATIC
src/ShaderLoader.cpp
src/ShaderSource.cpp
src/ShaderProgram.cpp)
target_link_libraries(
${PROJECT_NAME}
PUBLIC
GLEW::GLEW
)
#MSVC debugging tools like edit and continue
if(MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC "/ZI")
target_link_options(${PROJECT_NAME} PUBLIC "/INCREMENTAL")
endif()
set_target_properties(
${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1.0.0
PUBLIC_HEADER ${HEADER}
)
target_include_directories(
${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}> # <prefix>/include/mylib
)
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
EXPORT ${PROJECT_NAME}-targets
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
# TESTS
add_subdirectory(tests)