CMakeLists.txt 3.13 KB
Newer Older
Benjamin Heisch's avatar
Benjamin Heisch committed
1
cmake_minimum_required (VERSION 3.13)
2
3
4
project(XPlug)

##########INCLUDES############
5
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake)
6
7
8
9


#########PACKAGE INCLUDES#########
find_package(Jack)
10
find_package(Backport QUIET)
11

12
#include(DPFFunctions) ## for Function use documentation look into DPFFuncitons or in the Examples.
13
include(version NO_POLICY_SCOPE)
14
include(symbol_export)
15
include(GenerateExportHeader)
16
17

#########Settings#############
18
option(XPLUG_BUILD_EXAMPLES "Build Examples" ON)
19
option(XPLUG_BUILD_DOC "Build Documentation" OFF)
20
option(XPLUG_BUILD_TESTS "Build and installs tests,which can be reused and are used in the examples." ON)
21
22
#option(XPLUG_USE_PLUGINVAL "Adds CMAKE Tests, which uses pluginval" ON)

23
24
#########################Set Supported Format Variables###########################
## Here add maybe an detect if feature is build ready macro or function.
25

26

27
28
29
30
option(XPLUG_AU_SUPPORT "Support vor AU" OFF)
option(XPLUG_JACK_SUPPORT "IS JACK SUPPORTED?" ${JACK_FOUND})


31

32
33

option(XPLUG_INSTALL "Install Xplug and Examples, if Build" ON)
34

35
set_version(0 1 0)
36
37
38


#####################BUILD######################
39
40
41
42
43
if(XPLUG_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif(XPLUG_BUILD_TESTS)

44
add_subdirectory(formats)
45
46
47
48
49

if(XPLUG_BUILD_EXAMPLES)
add_subdirectory(examples)
endif(XPLUG_BUILD_EXAMPLES)

50

51
52
add_subdirectory(include)
add_subdirectory(src)
53
add_subdirectory(deps)
54
55


56
add_library(XPlug STATIC ${XPLUG_INCLUDE_FILES} ${XPLUG_SOURCE_FILES}   )
57

58
target_link_libraries(XPlug PUBLIC ${CMAKE_DL_LIBS})
59
set_target_properties(XPlug PROPERTIES POSITION_INDEPENDENT_CODE  True VERSION  ${XPlug_VERSION_MAJOR})
Benjamin's avatar
Benjamin committed
60
target_compile_features(XPlug PUBLIC cxx_std_14)
61

Benjamin Heisch's avatar
Benjamin Heisch committed
62
EXPORT_SYMBOLS(XPlug FUNCTION_NAMES "XPlugGetVersion")
63
GENERATE_EXPORT_HEADER(XPlug)
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
GENERATE_VERSION_HEADER(XPlug VISIBILITY PRIVATE)
target_include_directories(XPlug PUBLIC  
 $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
 $<INSTALL_INTERFACE:include> )
 target_include_directories(XPlug PUBLIC  
 $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/generated>
 $<INSTALL_INTERFACE:include> )

if(XPLUG_INSTALL)

install(TARGETS XPlug EXPORT XPlugExport DESTINATION lib)
install(EXPORT XPlugExport NAMESPACE XPlug:: DESTINATION cmake)
install(FILES   cmake/FindJack.cmake
                cmake/Findpluginval.cmake
                cmake/FindTortureTester.cmake
                DESTINATION cmake)

set(CPACK_PACKAGE_NAME "XPlug")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "XPlug a Crossplattform audioplugin abstraction library")
set(CPACK_PACKAGE_DESCRIPTION "XPlug a Crossplattform audioplugin abstraction library")
set(CPACK_PACKAGE_VENDOR "Benjamin Heisch")
#set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
#set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
set(CPACK_PACKAGE_VERSION_MAJOR ${XPlug_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${XPlug_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${XPlug_VERSION_PATCH})
Heisch, Benjamin's avatar
Heisch, Benjamin committed
90
set(CPACK_PACKAGE_CONTACT "Benjamin Heisch")
91
#set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
Heisch, Benjamin's avatar
Heisch, Benjamin committed
92
#SET(CPACK_DEBIAN_PACKAGE_DEPENDS libc6 (>= 2.7-18) )
93
94
95
include(CPack)

endif(XPLUG_INSTALL)