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) ...@@ -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_CONVOLUTION_UPCONV_WITH_POWER_SAVER option (ITA_CONVOLUTION_UPCONV_WITH_POWER_SAVER
"Use power saving mode for uniform partitioned convolution (do not convolve blocks with zeros)" ON "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) ...@@ -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) 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.") message (FATAL_ERROR "Performance logger is deprecated, as the XML library cannot be found.")
endif () endif ()
#---END: Options---
#External libs
add_subdirectory (external_libs) add_subdirectory (external_libs)
#Library
add_library ( add_library (
${PROJECT_NAME} ${PROJECT_NAME}
include/ITAUPConvolution.h include/ITAUPConvolution.h
...@@ -56,6 +61,7 @@ add_library ( ...@@ -56,6 +61,7 @@ add_library (
) )
add_library (${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) add_library (${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
#Additional source files
if (ITA_CONVOLUTION_WITH_NUPCONV) if (ITA_CONVOLUTION_WITH_NUPCONV)
target_sources ( target_sources (
${PROJECT_NAME} ${PROJECT_NAME}
...@@ -113,22 +119,27 @@ if (ITA_CONVOLUTION_WITH_NUPCONV) ...@@ -113,22 +119,27 @@ if (ITA_CONVOLUTION_WITH_NUPCONV)
endif () endif ()
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/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) target_link_libraries (${PROJECT_NAME} PUBLIC ITABase::ITABase ITAFFT::ITAFFT TBB::tbb)
#Definitions for Shared/Static
target_compile_definitions ( target_compile_definitions (
${PROJECT_NAME} PUBLIC $<IF:$<BOOL:${BUILD_SHARED_LIBS}>,ITA_CONVOLUTION_EXPORT,ITA_CONVOLUTION_STATIC> ${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) 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) 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 ${PROJECT_NAME} NAME ${PROJECT_NAME}
VERSION ${PROJECT_VERSION} VERSION ${PROJECT_VERSION}
...@@ -141,12 +152,12 @@ packageProject ( ...@@ -141,12 +152,12 @@ packageProject (
DISABLE_VERSION_SUFFIX YES DISABLE_VERSION_SUFFIX YES
) )
# benchmarks #Benchmarks
if (ITA_CONVOLUTION_WITH_BENCHMARKS) if (ITA_CONVOLUTION_WITH_BENCHMARKS)
add_subdirectory (benchmarks) add_subdirectory (benchmarks)
endif () endif ()
# profiler #Profiler
if (ITA_CONVOLUTION_WITH_PROFILERS if (ITA_CONVOLUTION_WITH_PROFILERS
AND ITA_CONVOLUTION_NUPCONV_WITH_PERFORMANCE_LOGGER AND ITA_CONVOLUTION_NUPCONV_WITH_PERFORMANCE_LOGGER
AND ITA_CONVOLUTION_WITH_NUPCONV AND ITA_CONVOLUTION_WITH_NUPCONV
...@@ -154,12 +165,12 @@ if (ITA_CONVOLUTION_WITH_PROFILERS ...@@ -154,12 +165,12 @@ if (ITA_CONVOLUTION_WITH_PROFILERS
add_subdirectory (profilers) add_subdirectory (profilers)
endif () endif ()
# apps #Apps
if (ITA_CONVOLUTION_WITH_APPS) if (ITA_CONVOLUTION_WITH_APPS)
add_subdirectory (apps) add_subdirectory (apps)
endif () endif ()
# tests #Tests
if (ITA_CONVOLUTION_WITH_TESTS) if (ITA_CONVOLUTION_WITH_TESTS)
add_subdirectory (tests) add_subdirectory (tests)
endif () 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