Skip to content
Snippets Groups Projects
Commit 54fdfa64 authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

CMake: fixed bug in INSTALL_INTERFACE and added comments

parent d1ef3edc
No related branches found
No related tags found
No related merge requests found
...@@ -14,10 +14,12 @@ if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY AND WIN32) ...@@ -14,10 +14,12 @@ if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY AND WIN32)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/lib) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/lib)
endif () endif ()
# Organize targest in folders in Visual Studio
if (CMAKE_GENERATOR MATCHES "Visual Studio") if (CMAKE_GENERATOR MATCHES "Visual Studio")
set_property (GLOBAL PROPERTY USE_FOLDERS ON) set_property (GLOBAL PROPERTY USE_FOLDERS ON)
endif () endif ()
#---Options---
option (ITA_CTC_WITH_DUAL_CTC "Build support for Crosstalk-Cancellation with arbitrary loudspeaker number and pose" OFF) option (ITA_CTC_WITH_DUAL_CTC "Build support for Crosstalk-Cancellation with arbitrary loudspeaker number and pose" OFF)
option (ITA_CTC_WITH_N_CTC "Build support for two-loudspeaker Crosstalk-Cancellation (deprecated)" ON) option (ITA_CTC_WITH_N_CTC "Build support for two-loudspeaker Crosstalk-Cancellation (deprecated)" ON)
option (ITA_CTC_WITH_QUAD_CTC "Build support for quad-loudspeaker Crosstalk-Cancellation (deprecated)" OFF) option (ITA_CTC_WITH_QUAD_CTC "Build support for quad-loudspeaker Crosstalk-Cancellation (deprecated)" OFF)
...@@ -26,12 +28,16 @@ option (ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE ...@@ -26,12 +28,16 @@ option (ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE
OFF OFF
) )
option (ITA_CTC_WITH_TESTS "Build the tests for the library" OFF) option (ITA_CTC_WITH_TESTS "Build the tests for the library" OFF)
#---END: Options---
#External libs
add_subdirectory (external_libs) add_subdirectory (external_libs)
#Library
add_library (${PROJECT_NAME} include/ITACTCDefinitions.h) add_library (${PROJECT_NAME} include/ITACTCDefinitions.h)
add_library (${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) add_library (${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
#Additional source files
if (ITA_CTC_WITH_DUAL_CTC) if (ITA_CTC_WITH_DUAL_CTC)
target_sources ( target_sources (
${PROJECT_NAME} PRIVATE include/ITADualCTC.h include/ITADualCTCStreamFilter.h src/ITADualCTC.cpp ${PROJECT_NAME} PRIVATE include/ITADualCTC.h include/ITADualCTCStreamFilter.h src/ITADualCTC.cpp
...@@ -51,27 +57,34 @@ if (ITA_CTC_WITH_QUAD_CTC) ...@@ -51,27 +57,34 @@ if (ITA_CTC_WITH_QUAD_CTC)
) )
endif () endif ()
#Set include directory for library
target_include_directories ( target_include_directories (
${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:INCLUDE_PATH/ITACTC> ${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ITACTC>
) )
#Linking
target_link_libraries ( target_link_libraries (
${PROJECT_NAME} PRIVATE ITABase::ITABase ITAFFT::ITAFFT ITADataSources::ITADataSources DAFF ${PROJECT_NAME} PRIVATE ITABase::ITABase ITAFFT::ITAFFT ITADataSources::ITADataSources DAFF
ITAConvolution::ITAConvolution DAFF ITAConvolution::ITAConvolution DAFF
) )
#---Compile definitions---
if (ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE) if (ITA_CTC_NCTC_EXPORT_FILTER_TO_HARDDRIVE)
target_compile_definitions (${PROJECT_NAME} PRIVATE NCTC_EXPORT_FILTER_TO_HARDDRIVE) target_compile_definitions (${PROJECT_NAME} PRIVATE NCTC_EXPORT_FILTER_TO_HARDDRIVE)
endif () endif ()
#Definitions for Shared/Static
target_compile_definitions (${PROJECT_NAME} PUBLIC $<IF:$<BOOL:${BUILD_SHARED_LIBS}>,ITA_CTC_EXPORT,ITA_CTC_STATIC>) target_compile_definitions (${PROJECT_NAME} PUBLIC $<IF:$<BOOL:${BUILD_SHARED_LIBS}>,ITA_CTC_EXPORT,ITA_CTC_STATIC>)
#Required compiler features
target_compile_features (${PROJECT_NAME} PUBLIC cxx_std_11) target_compile_features (${PROJECT_NAME} PUBLIC cxx_std_11)
#---END: Compile definitions---
#If build out of VA project, add parent folder "ITACoreLibs"
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "ITACoreLibs") set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "ITACoreLibs")
endif () endif ()
#Install & export
packageProject ( packageProject (
NAME ITACTC NAME ITACTC
VERSION ${PROJECT_VERSION} VERSION ${PROJECT_VERSION}
...@@ -84,7 +97,7 @@ packageProject ( ...@@ -84,7 +97,7 @@ packageProject (
DISABLE_VERSION_SUFFIX YES DISABLE_VERSION_SUFFIX YES
) )
# tests #Tests
if (ITA_CTC_WITH_TESTS) if (ITA_CTC_WITH_TESTS)
add_subdirectory (tests) add_subdirectory (tests)
endif () endif ()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment