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

##########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
19
20
21
option(APAL_BUILD_EXAMPLES "Build Examples" ON)
option(APAL_BUILD_DOC "Build Documentation" OFF)
option(APAL_BUILD_TESTS "Build and installs tests,which can be reused and are used in the examples." ON)
#option(APAL_USE_PLUGINVAL "Adds CMAKE Tests, which uses pluginval" ON)
22

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

26

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


31

32

33
option(APAL_INSTALL "Install APAL and Examples, if Build" ON)
34

35
set_version(0 1 0)
36
37
38


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

44
add_subdirectory(formats)
45

46
if(APAL_BUILD_EXAMPLES)
47
add_subdirectory(examples)
48
endif(APAL_BUILD_EXAMPLES)
49

50

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


56
add_library(APAL STATIC ${APAL_INCLUDE_FILES} ${APAL_SOURCE_FILES}   )
57

58
59
60
target_link_libraries(APAL PUBLIC ${CMAKE_DL_LIBS})
set_target_properties(APAL PROPERTIES POSITION_INDEPENDENT_CODE  True VERSION  ${APAL_VERSION_MAJOR})
target_compile_features(APAL PUBLIC cxx_std_14)
61

62
63
64
65
EXPORT_SYMBOLS(APAL FUNCTION_NAMES "APALGetVersion")
GENERATE_EXPORT_HEADER(APAL)
GENERATE_VERSION_HEADER(APAL VISIBILITY PRIVATE)
target_include_directories(APAL PUBLIC  
66
67
 $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
 $<INSTALL_INTERFACE:include> )
68
 target_include_directories(APAL PUBLIC  
69
70
71
 $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/generated>
 $<INSTALL_INTERFACE:include> )

72
if(APAL_INSTALL)
73

74
75
install(TARGETS APAL EXPORT APALExport DESTINATION lib)
install(EXPORT APALExport NAMESPACE APAL:: DESTINATION cmake)
76
77
78
79
80
install(FILES   cmake/FindJack.cmake
                cmake/Findpluginval.cmake
                cmake/FindTortureTester.cmake
                DESTINATION cmake)

81
82
83
set(CPACK_PACKAGE_NAME "APAL")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "APAL a Crossplattform audioplugin abstraction library")
set(CPACK_PACKAGE_DESCRIPTION "APAL a Crossplattform audioplugin abstraction library")
84
85
86
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")
87
88
89
set(CPACK_PACKAGE_VERSION_MAJOR ${APAL_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${APAL_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${APAL_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
include(CPack)

95
endif(APAL_INSTALL)