-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (42 loc) · 1.3 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
cmake_minimum_required(VERSION 3.26)
project(QS VERSION 0.1.1 LANGUAGES CXX)
include(CMakePackageConfigHelpers)
set(QS_NAMESPACE quark)
option(QS_TESTS "Enable testing" OFF)
if (QS_TESTS)
include(CTest)
enable_testing()
add_subdirectory(test)
endif()
option(QS_EXAMPLES "Enable sample plugins" OFF)
if (QS_EXAMPLES)
add_subdirectory(examples)
endif()
if(COMMAND juce_add_module)
juce_add_module(qs ALIAS_NAMESPACE "${QS_NAMESPACE}")
endif()
set(QS_INCLUDE_PATH "include/${PROJECT_NAME}-${QS_VERSION}")
install(
DIRECTORY qs
DESTINATION ${QS_INCLUDE_PATH}
PATTERN ".DS_Store" EXCLUDE
)
# QSConfigVersion.cmake
set(QS_CMAKE_CONFIG_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
write_basic_package_version_file(
${QS_CMAKE_CONFIG_VERSION_FILE}
COMPATIBILITY SameMajorVersion
)
# QSConfig.cmake
set(QS_CMAKE_CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
set(QS_PACKAGE_INSTALL_PATH "lib/cmake/${PROJECT_NAME}-${QS_VERSION}")
configure_package_config_file(
"${PROJECT_NAME}Config.cmake.in"
${QS_CMAKE_CONFIG_FILE}
INSTALL_DESTINATION ${QS_PACKAGE_INSTALL_PATH}
PATH_VARS QS_INCLUDE_PATH
)
install(
FILES ${QS_CMAKE_CONFIG_FILE} ${QS_CMAKE_CONFIG_VERSION_FILE}
DESTINATION ${QS_PACKAGE_INSTALL_PATH}
)