Browse Source

cmake: install code headers and pkgconfig file

Signed-off-by: falkTX <falktx@falktx.com>
pull/1780/head
falkTX 1 year ago
parent
commit
92dcc09c4a
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 86 additions and 2 deletions
  1. +1
    -1
      Makefile
  2. +76
    -1
      cmake/CMakeLists.txt
  3. +9
    -0
      cmake/carla-utils.pc.in

+ 1
- 1
Makefile View File

@@ -22,7 +22,7 @@ else
MODULEDIR := $(CURDIR)/build/modules/Release
endif

# see also source/common/__init__.py and source/includes/CarlaDefines.h
# see also cmake/CMakeLists.txt, source/common/__init__.py and source/includes/CarlaDefines.h
VERSION := 2.6.0-alpha1

-include Makefile.user.mk


+ 76
- 1
cmake/CMakeLists.txt View File

@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.15)
project(carla)

set(PROJECT_VERSION 2.6.0-alpha1)

set(CMAKE_POLICY_DEFAULT_CMP0025 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
@@ -43,6 +45,8 @@ set(CARLA_USE_OSC ${CARLA_USE_OSC_DEFAULT} CACHE BOOL "Enable OSC")
#######################################################################################################################
# required dependencies

include(GNUInstallDirs)

find_package(Threads REQUIRED)

if(NOT (APPLE OR HAIKU OR WIN32))
@@ -677,6 +681,8 @@ add_executable(carla-bridge-native)

set_common_target_properties(carla-bridge-native)

install(TARGETS carla-bridge-native RUNTIME)

target_compile_definitions(carla-bridge-native
PRIVATE
BUILD_BRIDGE
@@ -760,6 +766,8 @@ add_executable(carla-discovery-native)

set_common_target_properties(carla-discovery-native)

install(TARGETS carla-discovery-native RUNTIME)

target_include_directories(carla-discovery-native
PRIVATE
../source/backend
@@ -790,6 +798,8 @@ add_library(carla::standalone ALIAS carla-standalone)

set_common_target_properties(carla-standalone)

install(TARGETS carla-standalone LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla)

set_target_properties(carla-standalone
PROPERTIES
OUTPUT_NAME carla_standalone2
@@ -878,7 +888,9 @@ add_library(carla::utils ALIAS carla-utils)

set_common_target_properties(carla-utils)

set_target_properties(carla-standalone
install(TARGETS carla-utils LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla)

set_target_properties(carla-utils
PROPERTIES
OUTPUT_NAME carla_utils
)
@@ -935,3 +947,66 @@ if(APPLE)
endif()

#######################################################################################################################
# install code headers

add_library(carla-headers-backend INTERFACE)
add_library(carla-headers-includes INTERFACE)
add_library(carla-headers-utils INTERFACE)

install(TARGETS carla-headers-backend PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla)
install(TARGETS carla-headers-includes PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/includes)
install(TARGETS carla-headers-utils PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/utils)

set_property(TARGET carla-headers-backend
PROPERTY PUBLIC_HEADER
../source/backend/CarlaBackend.h
../source/backend/CarlaHost.h
../source/backend/CarlaUtils.h
../source/backend/CarlaEngine.hpp
../source/backend/CarlaPlugin.hpp
../source/backend/CarlaPluginPtr.hpp
)

set_property(TARGET carla-headers-includes
PROPERTY PUBLIC_HEADER
../source/includes/CarlaDefines.h
../source/includes/CarlaMIDI.h
../source/includes/CarlaNative.h
../source/includes/CarlaNativePlugin.h
)

set_property(TARGET carla-headers-utils
PROPERTY PUBLIC_HEADER
../source/utils/CarlaBackendUtils.hpp
../source/utils/CarlaBase64Utils.hpp
../source/utils/CarlaBinaryUtils.hpp
../source/utils/CarlaBridgeDefines.hpp
../source/utils/CarlaBridgeUtils.hpp
../source/utils/CarlaMacUtils.hpp
../source/utils/CarlaMathUtils.hpp
../source/utils/CarlaMutex.hpp
../source/utils/CarlaRingBuffer.hpp
../source/utils/CarlaProcessUtils.hpp
../source/utils/CarlaRunner.hpp
../source/utils/CarlaScopeUtils.hpp
../source/utils/CarlaSemUtils.hpp
../source/utils/CarlaSha1Utils.hpp
../source/utils/CarlaShmUtils.hpp
../source/utils/CarlaString.hpp
../source/utils/CarlaThread.hpp
../source/utils/CarlaTimeUtils.hpp
../source/utils/CarlaUtils.hpp
)

#######################################################################################################################
# pkg-config stuff

configure_file(carla-utils.pc.in carla-utils.pc @ONLY)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/carla-utils.pc
DESTINATION
${CMAKE_INSTALL_LIBDIR}/pkgconfig
)

#######################################################################################################################

+ 9
- 0
cmake/carla-utils.pc.in View File

@@ -0,0 +1,9 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=@CMAKE_INSTALL_LIBDIR@
includedir=@CMAKE_INSTALL_INCLUDEDIR@

Name: carla-utils
Version: @PROJECT_VERSION@
Description: Carla Host Utilities
Libs: -L${libdir}/carla -lcarla_utils
Cflags: -I${includedir}/carla -I${includedir}/carla/includes -I${includedir}/carla/utils

Loading…
Cancel
Save