Commit 4bf3570a authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Format CMakeLists

parent 841ffd75
......@@ -19,7 +19,7 @@ if (CMAKE_GENERATOR MATCHES "Visual Studio")
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
endif ()
#---Options---
# ---Options---
option (ITA_CONVOLUTION_UPCONV_WITH_POWER_SAVER
"Use power saving mode for uniform partitioned convolution (do not convolve blocks with zeros)" ON
)
......@@ -38,12 +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---
# ---END: Options---
#External libs
# External libs
add_subdirectory (external_libs)
#Library
# Library
add_library (
${PROJECT_NAME}
include/ITAUPConvolution.h
......@@ -61,7 +61,7 @@ add_library (
)
add_library (${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
#Additional source files
# Additional source files
if (ITA_CONVOLUTION_WITH_NUPCONV)
target_sources (
${PROJECT_NAME}
......@@ -119,30 +119,31 @@ if (ITA_CONVOLUTION_WITH_NUPCONV)
endif ()
endif ()
#Set include directory for library
# Set include directory for library
target_include_directories (
${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ITAConvolution>
${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ITAConvolution>
)
#Linking
# Linking
target_link_libraries (${PROJECT_NAME} PUBLIC ITABase::ITABase ITAFFT::ITAFFT TBB::tbb)
#Definitions for Shared/Static
# Definitions for Shared/Static
target_compile_definitions (
${PROJECT_NAME} PUBLIC $<IF:$<BOOL:${BUILD_SHARED_LIBS}>,ITA_CONVOLUTION_EXPORT,ITA_CONVOLUTION_STATIC>
)
#Required compiler features
# Required compiler features
target_compile_features (${PROJECT_NAME} PUBLIC cxx_std_11)
#If build out of ITACoreLibs project, add parent folder "ITACoreLibs"
# If build out of ITACoreLibs project, add parent folder "ITACoreLibs"
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "ITACoreLibs")
endif ()
# Organize sources in folders
GroupSourcesByFolder(${PROJECT_NAME})
groupsourcesbyfolder (${PROJECT_NAME})
#Install & export
# Install & export
packageProject (
NAME ${PROJECT_NAME}
VERSION ${PROJECT_VERSION}
......@@ -155,12 +156,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
......@@ -168,12 +169,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 ()
......@@ -26,31 +26,28 @@ CPMAddPackage (
if (tbb_ADDED)
set_target_properties (tbb tbbmalloc tbbmalloc_proxy PROPERTIES FOLDER "external_libs")
#TBB sets all output directories for debug/release so we must overwrite them
# TBB sets all output directories for debug/release so we must overwrite them
if (WIN32)
if (CMAKE_PDB_OUTPUT_DIRECTORY)
set( _pdb_dir ${CMAKE_PDB_OUTPUT_DIRECTORY} )
else()
set( _pdb_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
endif()
set (_pdb_dir ${CMAKE_PDB_OUTPUT_DIRECTORY})
else ()
set (_pdb_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif ()
set_target_properties (
tbb tbbmalloc tbbmalloc_proxy PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
PDB_OUTPUT_DIRECTORY ${_pdb_dir}
PDB_OUTPUT_DIRECTORY_DEBUG ${_pdb_dir}
PDB_OUTPUT_DIRECTORY_RELEASE ${_pdb_dir}
tbb tbbmalloc tbbmalloc_proxy
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
PDB_OUTPUT_DIRECTORY ${_pdb_dir}
PDB_OUTPUT_DIRECTORY_DEBUG ${_pdb_dir}
PDB_OUTPUT_DIRECTORY_RELEASE ${_pdb_dir}
)
unset( _pdb_dir )
unset (_pdb_dir)
endif ()
endif ()
......@@ -18,7 +18,10 @@ add_executable (ITAUniformPartitionedConvolutionTest ITAUniformPartitionedConvol
target_link_libraries (ITAUniformPartitionedConvolutionTest ITAConvolution::ITAConvolution)
set_property (TARGET ITAUniformPartitionedConvolutionTest PROPERTY FOLDER "Tests/ITAConvolution")
set_property (TARGET ITAUniformPartitionedConvolutionTest PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set_property (
TARGET ITAUniformPartitionedConvolutionTest PROPERTY VS_DEBUGGER_WORKING_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
)
install (TARGETS ITAUniformPartitionedConvolutionTest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
......
......@@ -40,7 +40,9 @@ if (ITA_CONVOLUTION_NUPCONV_WITH_PERFORMANCE_LOGGER)
target_link_libraries (NUPConvPerformanceProvileView ITAConvolution::ITAConvolution)
set_property (TARGET NUPConvPerformanceProvileView PROPERTY FOLDER "Tests/ITAConvolution/NUP")
set_property (TARGET NUPConvPerformanceProvileView PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set_property (
TARGET NUPConvPerformanceProvileView PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
)
install (TARGETS NUPConvPerformanceProvileView RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
......
Markdown is supported
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