diff options
34 files changed, 111 insertions, 80 deletions
diff --git a/Help/command/get_directory_property.rst b/Help/command/get_directory_property.rst index 218efa9..39015cc 100644 --- a/Help/command/get_directory_property.rst +++ b/Help/command/get_directory_property.rst @@ -8,9 +8,14 @@ Get a property of ``DIRECTORY`` scope. get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>) Stores a property of directory scope in the named ``<variable>``. + The ``DIRECTORY`` argument specifies another directory from which to retrieve the property value instead of the current directory. -The specified directory must have already been traversed by CMake. +It may reference either a source directory, or since CMake 3.19, +a binary directory. Relative paths are treated as relative to the +current source directory. CMake must already know about the directory, +either by having added it through a call to :command:`add_subdirectory` +or being the top level directory. If the property is not defined for the nominated directory scope, an empty string is returned. In the case of ``INHERITED`` properties, diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst index 0602518..870c934 100644 --- a/Help/command/get_property.rst +++ b/Help/command/get_property.rst @@ -30,7 +30,9 @@ It must be one of the following: ``DIRECTORY`` Scope defaults to the current directory but another directory (already processed by CMake) may be named by the - full or relative path ``<dir>``. + full or relative path ``<dir>``. The ``<dir>`` may reference either a + source directory, or since CMake 3.19, a binary directory. + Relative paths are treated as relative to the current source directory. See also the :command:`get_directory_property` command. ``TARGET`` @@ -44,10 +46,11 @@ It must be one of the following: ``DIRECTORY <dir>`` The source file property will be read from the ``<dir>`` directory's - scope. CMake must already know about that source directory, either by - having added it through a call to :command:`add_subdirectory` or ``<dir>`` - being the top level source directory. Relative paths are treated as - relative to the current source directory. + scope. The ``<dir>`` may reference either a source directory, or + since CMake 3.19, a binary directory. CMake must already know about + the directory, either by having added it through a call + to :command:`add_subdirectory` or ``<dir>`` being the top level directory. + Relative paths are treated as relative to the current source directory. ``TARGET_DIRECTORY <target>`` The source file property will be read from the directory scope in which diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst index 93c2d9c..b5c1613 100644 --- a/Help/command/set_property.rst +++ b/Help/command/set_property.rst @@ -26,8 +26,11 @@ It must be one of the following: Scope is unique and does not accept a name. ``DIRECTORY`` - Scope defaults to the current directory but another directory + Scope defaults to the current directory but other directories (already processed by CMake) may be named by full or relative path. + Each path may reference either a source directory, or since CMake 3.19, + a binary directory. + Relative paths are treated as relative to the current source directory. See also the :command:`set_directory_properties` command. ``TARGET`` @@ -42,8 +45,9 @@ It must be one of the following: ``DIRECTORY <dirs>...`` The source file property will be set in each of the ``<dirs>`` - directories' scopes. CMake must already know about each of these - source directories, either by having added them through a call to + directories' scopes. Each path may reference either a source directory, + or since CMake 3.19, a binary directory. CMake must already know about + each of these directories, either by having added them through a call to :command:`add_subdirectory` or it being the top level source directory. Relative paths are treated as relative to the current source directory. diff --git a/Help/release/dev/binary-dir-props.rst b/Help/release/dev/binary-dir-props.rst new file mode 100644 index 0000000..b36d86d --- /dev/null +++ b/Help/release/dev/binary-dir-props.rst @@ -0,0 +1,7 @@ +binary-dir-props +---------------- + +* The :command:`set_property`, :command:`get_property`, + and :command:`get_directory_property` commands' ``DIRECTORY`` + options now accept references to binary directory paths, + such as the value of :variable:`CMAKE_CURRENT_BINARY_DIR`. diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e26ab8b..b715531 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 18) -set(CMake_VERSION_PATCH 20200922) +set(CMake_VERSION_PATCH 20200923) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 58aa391..cbae4e5 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -565,11 +565,9 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties( ifaceProperties); if (gtarget->GetType() != cmStateEnums::INTERFACE_LIBRARY) { - getCompatibleInterfaceProperties(gtarget, ifaceProperties, ""); - std::vector<std::string> configNames = gtarget->Target->GetMakefile()->GetGeneratorConfigs( - cmMakefile::ExcludeEmptyConfig); + cmMakefile::IncludeEmptyConfig); for (std::string const& cn : configNames) { getCompatibleInterfaceProperties(gtarget, ifaceProperties, cn); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index ce1a4ec..86b01bc 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2353,13 +2353,13 @@ std::string cmGlobalGenerator::IndexGeneratorTargetUniquely( void cmGlobalGenerator::IndexMakefile(cmMakefile* mf) { - // FIXME: add_subdirectory supports multiple build directories - // sharing the same source directory. We currently index only the - // first one, because that is what FindMakefile has always returned. - // All of its callers will need to be modified to support looking - // up directories by build directory path. + // We index by both source and binary directory. add_subdirectory + // supports multiple build directories sharing the same source directory. + // The source directory index will reference only the first time it is used. this->MakefileSearchIndex.insert( MakefileMap::value_type(mf->GetCurrentSourceDirectory(), mf)); + this->MakefileSearchIndex.insert( + MakefileMap::value_type(mf->GetCurrentBinaryDirectory(), mf)); } void cmGlobalGenerator::IndexLocalGenerator(cmLocalGenerator* lg) diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 6ca763b..df6a38a 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -113,7 +113,7 @@ bool HandleSourceFileDirectoryScopes( "given non-existent target for TARGET_DIRECTORY ", target_name)); return false; } - cmProp target_source_dir = target->GetProperty("SOURCE_DIR"); + cmProp target_source_dir = target->GetProperty("BINARY_DIR"); cmMakefile* target_dir_mf = status.GetMakefile().GetGlobalGenerator()->FindMakefile( *target_source_dir); diff --git a/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt index f4ad83a..50338cf 100644 --- a/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt +++ b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(CXXStandardSetTwice CXX CUDA) set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(CXXStandardSetTwice main.cu) target_compile_features(CXXStandardSetTwice PUBLIC cxx_std_11) diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt index 265bd85..63defdf 100644 --- a/Tests/Cuda/Complex/CMakeLists.txt +++ b/Tests/Cuda/Complex/CMakeLists.txt @@ -1,6 +1,5 @@ - -cmake_minimum_required(VERSION 3.7) -project (Complex CXX CUDA) +cmake_minimum_required(VERSION 3.18) +project(Complex CXX CUDA) #Goal for this example: #build a cpp dynamic library base @@ -14,8 +13,6 @@ project (Complex CXX CUDA) #this tests that we can properly handle linking cuda and cpp together #and also building cpp targets that need cuda implicit libraries -#verify that we can pass explicit cuda arch flags -set(CMAKE_CUDA_ARCHITECTURES 30) set(CMAKE_CUDA_STANDARD 11) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD_REQUIRED TRUE) diff --git a/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt b/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt index 7098a7d..b01b9d7 100644 --- a/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt +++ b/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt @@ -1,6 +1,5 @@ - -cmake_minimum_required(VERSION 3.7) -project (ConsumeCompileFeatures CXX CUDA) +cmake_minimum_required(VERSION 3.18) +project(ConsumeCompileFeatures CXX CUDA) #Goal for this example: #build a c++11 library that express a c++11 public compile feature diff --git a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt index e40ffa6..ac2b2f5 100644 --- a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels1 CXX CUDA) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(MixedStandardLevels1 main.cu lib.cpp) diff --git a/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt index 7af8081..9ef734b 100644 --- a/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels2 CXX CUDA) set(CMAKE_CXX_STANDARD 17) #this can decay -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(MixedStandardLevels2 main.cu lib.cpp) target_compile_features(MixedStandardLevels2 PUBLIC cuda_std_11) diff --git a/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt index 2c42003..629d99c 100644 --- a/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt @@ -1,8 +1,6 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels3 CXX CUDA) -set(CMAKE_CUDA_ARCHITECTURES 30) - add_executable(MixedStandardLevels3 main.cu lib.cpp) target_compile_features(MixedStandardLevels3 PUBLIC cuda_std_03 cxx_std_14) diff --git a/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt index 230230d..8ce57ca 100644 --- a/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels4 CXX CUDA) set(CMAKE_CUDA_STANDARD 03) -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(MixedStandardLevels4 main.cu lib.cpp) target_compile_features(MixedStandardLevels4 PUBLIC cxx_std_14) diff --git a/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt index 5f5ee06..a3c3557 100644 --- a/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels5 CXX CUDA) set(CMAKE_CXX_STANDARD 98) -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(MixedStandardLevels5 main.cu lib.cpp) diff --git a/Tests/Cuda/ObjectLibrary/CMakeLists.txt b/Tests/Cuda/ObjectLibrary/CMakeLists.txt index 395bd38..d308514 100644 --- a/Tests/Cuda/ObjectLibrary/CMakeLists.txt +++ b/Tests/Cuda/ObjectLibrary/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project (ObjectLibrary CUDA CXX) #Goal for this example: # diff --git a/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt b/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt index fe28c3e..43068d9 100644 --- a/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt +++ b/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.18) project(ProperDeviceLibraries CXX CUDA) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 35) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads) diff --git a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt index d38da6d..862b03b 100644 --- a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt +++ b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt @@ -1,6 +1,5 @@ - -cmake_minimum_required(VERSION 3.7) -project (ProperLinkFlags CUDA CXX) +cmake_minimum_required(VERSION 3.18) +project(ProperLinkFlags CUDA CXX) #Goal for this example: #Verify that when we have CXX and CUDA enabled and we link an executable that @@ -19,7 +18,6 @@ set(CMAKE_CXX_FLAGS "-Wall") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 35) add_executable(ProperLinkFlags file1.cu main.cxx) set_target_properties( ProperLinkFlags diff --git a/Tests/Cuda/ProperLinkFlags/file1.cu b/Tests/Cuda/ProperLinkFlags/file1.cu index 9a105f0..1ce63bf 100644 --- a/Tests/Cuda/ProperLinkFlags/file1.cu +++ b/Tests/Cuda/ProperLinkFlags/file1.cu @@ -3,7 +3,6 @@ result_type __device__ file1_func(int x) { - __ldg(&x); result_type r; r.input = x; r.sum = x * x; diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt b/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt index 48df558..61a3190 100644 --- a/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt +++ b/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.18) project(SharedRuntimePlusToolkit CXX) #Goal for this example: diff --git a/Tests/Cuda/WithC/CMakeLists.txt b/Tests/Cuda/WithC/CMakeLists.txt index 049cbce..cc5fa0c 100644 --- a/Tests/Cuda/WithC/CMakeLists.txt +++ b/Tests/Cuda/WithC/CMakeLists.txt @@ -1,8 +1,6 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(WithC CUDA C) -set(CMAKE_CUDA_ARCHITECTURES 30) - add_executable(CudaWithC main.c cuda.cu) if(APPLE) diff --git a/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt b/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt index e10a348..caf9391 100644 --- a/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt +++ b/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.7) -project (CircularLinkLine CUDA) +cmake_minimum_required(VERSION 3.18) +project(CircularLinkLine CUDA) #Goal for this example: # Verify that we de-duplicate the device link line @@ -7,7 +7,6 @@ project (CircularLinkLine CUDA) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) add_library(CUDACircularDeviceLinking1 STATIC file1.cu) add_library(CUDACircularDeviceLinking2 STATIC file2.cu) diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt index 1265660..c8e8ebc 100644 --- a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt +++ b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.13) -project (DontResolveDeviceSymbols CUDA) +cmake_minimum_required(VERSION 3.18) +project(DontResolveDeviceSymbols CUDA) # Find nm and dumpbin if(CMAKE_NM) @@ -26,7 +26,6 @@ endif() # Verify that we can't use those device symbols from anything set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30 50) set(CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS OFF) add_library(CUDANoDeviceResolve SHARED file1.cu) diff --git a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt index 6675655..e9c0c1b 100644 --- a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt +++ b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt @@ -1,9 +1,7 @@ - -cmake_minimum_required(VERSION 3.7) -project (GPUDebugFlag CUDA) +cmake_minimum_required(VERSION 3.18) +project(GPUDebugFlag CUDA) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) # Goal for this example: # Verify that enabling device debug works. diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt index bd94ec8..a44b2f2 100644 --- a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt +++ b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project (ResolveDeviceSymbols CUDA) # Find nm and dumpbin @@ -21,8 +21,6 @@ endif() # confirming that the first static library is on the device link line # 3. Verify that we can't use those device symbols from anything that links # to the static library -set(CMAKE_CUDA_ARCHITECTURES 30 50) - add_library(CUDAResolveDeviceDepsA STATIC file1.cu) add_library(CUDAResolveDeviceDepsB STATIC file2.cu) target_compile_features(CUDAResolveDeviceDepsA PUBLIC cuda_std_11) diff --git a/Tests/CudaOnly/RuntimeControls/CMakeLists.txt b/Tests/CudaOnly/RuntimeControls/CMakeLists.txt index 0da5739..b3b2210 100644 --- a/Tests/CudaOnly/RuntimeControls/CMakeLists.txt +++ b/Tests/CudaOnly/RuntimeControls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project (RuntimeControls CUDA) # Find nm and dumpbin @@ -16,7 +16,6 @@ else() endif() set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) set(CMAKE_CUDA_RUNTIME_LIBRARY static) if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index 586be81..864ecbf 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -1,6 +1,5 @@ - -cmake_minimum_required(VERSION 3.7) -project (SeparateCompilation CUDA) +cmake_minimum_required(VERSION 3.18) +project(SeparateCompilation CUDA) #Goal for this example: #Build a static library that defines multiple methods and kernels that @@ -9,7 +8,6 @@ project (SeparateCompilation CUDA) #and executables. #We complicate the matter by also testing that multiple static libraries #all containing cuda separable compilation code links properly -set(CMAKE_CUDA_ARCHITECTURES 30 35 50 52) set(CMAKE_CUDA_SEPARABLE_COMPILATION ON) add_library(CUDASeparateLibA STATIC file1.cu file2.cu file3.cu) target_compile_features(CUDASeparateLibA PRIVATE cuda_std_11) diff --git a/Tests/CudaOnly/Standard98/CMakeLists.txt b/Tests/CudaOnly/Standard98/CMakeLists.txt index 3ba0360..6823352 100644 --- a/Tests/CudaOnly/Standard98/CMakeLists.txt +++ b/Tests/CudaOnly/Standard98/CMakeLists.txt @@ -1,8 +1,6 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(CudaOnlyStandard98 CUDA) -set(CMAKE_CUDA_ARCHITECTURES 30) - # Support setting CUDA Standard to 98 which internally gets transformed to # CUDA03 set(CMAKE_CUDA_STANDARD 98) diff --git a/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt b/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt index 708a352..534bab2 100644 --- a/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt +++ b/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.18) project(StaticRuntimePlusToolkit CUDA) #Goal for this example: diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt index 0ed81d8..02f043f 100644 --- a/Tests/CudaOnly/WithDefs/CMakeLists.txt +++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt @@ -1,9 +1,6 @@ +cmake_minimum_required(VERSION 3.18) +project(WithDefs CUDA) -cmake_minimum_required(VERSION 3.7) -project (WithDefs CUDA) - -#verify that we can pass explicit cuda arch flags -set(CMAKE_CUDA_ARCHITECTURES 30) set(release_compile_defs DEFREL) #Goal for this example: diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index 387fe6b..6d9b4ab 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -669,3 +669,18 @@ endif() # IMPORTED_LINK_INTERFACE_LANGUAGES entries should not be targets. add_library(C INTERFACE) add_library(CXX INTERFACE) + +#------------------------------------------------------------------------------ +# test export of targets built from sources named using $<CONFIG> generator-expression +# FIXME: Enable test on Xcode generator when it supports per-config sources. +if(NOT XCODE) + file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_$<CONFIG>.cpp" CONTENT "// content") + add_library(testStaticFromGeneratedSource STATIC) + target_sources(testStaticFromGeneratedSource PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/Generated_$<CONFIG>.cpp") + + add_library(testLibFromGeneratedSource SHARED empty.cpp) + target_link_libraries(testLibFromGeneratedSource PRIVATE testStaticFromGeneratedSource) + + install(TARGETS testLibFromGeneratedSource EXPORT testLibFromGeneratedSource_Export) + install(EXPORT testLibFromGeneratedSource_Export DESTINATION lib) +endif() diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt index 162a178..a1158c6 100644 --- a/Tests/Properties/CMakeLists.txt +++ b/Tests/Properties/CMakeLists.txt @@ -165,6 +165,34 @@ add_library(maindirtest SHARED) generate_file_for_set_property_test(32 maindirtest) generate_file_for_set_property_test(33 maindirtest) +# Set/get properties by binary directory path. +add_subdirectory(SubDir SubDirA) +get_property(dir_prop_top DIRECTORY PROPERTY dir_prop_top) +if(NOT dir_prop_top STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirA") + message(SEND_ERROR "dir_prop_top unexpected value after SubDirA:\n ${dir_prop_top}") +endif() +add_subdirectory(SubDir SubDirB) +get_property(dir_prop_top DIRECTORY PROPERTY dir_prop_top) +if(NOT dir_prop_top STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirB") + message(SEND_ERROR "dir_prop_top unexpected value after SubDirB:\n ${dir_prop_top}") +endif() +get_property(dir_prop_subA DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SubDirA PROPERTY dir_prop_sub) +if(NOT dir_prop_subA STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirA") + message(SEND_ERROR "SubDirA property dir_prop_sub incorrect:\n ${dir_prop_subA}") +endif() +get_property(dir_prop_subB DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SubDirB PROPERTY dir_prop_sub) +if(NOT dir_prop_subB STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirB") + message(SEND_ERROR "SubDirB property dir_prop_sub incorrect:\n ${dir_prop_subB}") +endif() +get_directory_property(dir_prop_subA DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SubDirA dir_prop_sub) +if(NOT dir_prop_subA STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirA") + message(SEND_ERROR "SubDirA property dir_prop_sub incorrect:\n ${dir_prop_subA}") +endif() +get_directory_property(dir_prop_subB DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SubDirB dir_prop_sub) +if(NOT dir_prop_subB STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirB") + message(SEND_ERROR "SubDirB property dir_prop_sub incorrect:\n ${dir_prop_subB}") +endif() + add_subdirectory(SubDir2) set(src_prefix "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/") diff --git a/Tests/Properties/SubDir/CMakeLists.txt b/Tests/Properties/SubDir/CMakeLists.txt new file mode 100644 index 0000000..f34cc8c --- /dev/null +++ b/Tests/Properties/SubDir/CMakeLists.txt @@ -0,0 +1,2 @@ +set_property(DIRECTORY PROPERTY dir_prop_sub ${CMAKE_CURRENT_BINARY_DIR}) +set_property(DIRECTORY ${CMAKE_BINARY_DIR} PROPERTY dir_prop_top ${CMAKE_CURRENT_BINARY_DIR}) |