Commit 215ed496 authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

CMake: fixed bug in INSTALL_INTERFACE and added comments

parent 9b0bc7dc
......@@ -14,10 +14,12 @@ if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY AND WIN32)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/lib)
endif ()
# Organize targest in folders in Visual Studio
if (CMAKE_GENERATOR MATCHES "Visual Studio")
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
endif ()
#---Options---
option (ITA_CONVOLUTION_UPCONV_WITH_POWER_SAVER
"Use power saving mode for uniform partitioned convolution (do not convolve blocks with zeros)" ON
)
......@@ -36,9 +38,12 @@ option (ITA_CONVOLUTION_WITH_TESTS "Build the tests for the library" OFF)
if (ITA_CONVOLUTION_NUPCONV_WITH_PERFORMANCE_LOGGER OR ITA_CONVOLUTION_NUPCONV_WITH_XML_READER)
message (FATAL_ERROR "Performance logger is deprecated, as the XML library cannot be found.")
endif ()
#---END: Options---
#External libs
add_subdirectory (external_libs)
#Library
add_library (
${PROJECT_NAME}
include/ITAUPConvolution.h
......@@ -56,6 +61,7 @@ add_library (
)
add_library (${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
#Additional source files
if (ITA_CONVOLUTION_WITH_NUPCONV)
target_sources (
${PROJECT_NAME}
......@@ -113,22 +119,27 @@ if (ITA_CONVOLUTION_WITH_NUPCONV)
endif ()
endif ()
#Set include directory for library
target_include_directories (
${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:INCLUDE_PATH/ITAConvolution>
${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ITAConvolution>
)
#Linking
target_link_libraries (${PROJECT_NAME} PUBLIC ITABase::ITABase ITAFFT::ITAFFT TBB::tbb)
#Definitions for Shared/Static
target_compile_definitions (
${PROJECT_NAME} PUBLIC $<IF:$<BOOL:${BUILD_SHARED_LIBS}>,ITA_CONVOLUTION_EXPORT,ITA_CONVOLUTION_STATIC>
)
#Required compiler features
target_compile_features (${PROJECT_NAME} PUBLIC cxx_std_11)
#If build out of VA project, add parent folder "ITACoreLibs"
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "ITACoreLibs")
endif ()
#Install & export
packageProject (
NAME ${PROJECT_NAME}
VERSION ${PROJECT_VERSION}
......@@ -141,12 +152,12 @@ packageProject (
DISABLE_VERSION_SUFFIX YES
)
# benchmarks
#Benchmarks
if (ITA_CONVOLUTION_WITH_BENCHMARKS)
add_subdirectory (benchmarks)
endif ()
# profiler
#Profiler
if (ITA_CONVOLUTION_WITH_PROFILERS
AND ITA_CONVOLUTION_NUPCONV_WITH_PERFORMANCE_LOGGER
AND ITA_CONVOLUTION_WITH_NUPCONV
......@@ -154,12 +165,12 @@ if (ITA_CONVOLUTION_WITH_PROFILERS
add_subdirectory (profilers)
endif ()
# apps
#Apps
if (ITA_CONVOLUTION_WITH_APPS)
add_subdirectory (apps)
endif ()
# tests
#Tests
if (ITA_CONVOLUTION_WITH_TESTS)
add_subdirectory (tests)
endif ()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment