From c80eb2ff830623b6768505eb455c23dbbfdbf0f9 Mon Sep 17 00:00:00 2001 From: Jared Duffey Date: Fri, 1 Sep 2023 13:22:44 -0400 Subject: [PATCH] Replaced CMAKE_CFG_INTDIR with $ * CMAKE_CFG_INTDIR is deprecated * Fixes packaging with Visual Studio generator * Removed file(MAKE_DIRECTORY) calls that use variables with $ since it can't use generator expressions and the calls aren't required Signed-off-by: Jared Duffey --- CMakeLists.txt | 11 ++--------- cmake/Utility.cmake | 8 ++------ src/Plugins/ComplexCore/CMakeLists.txt | 4 ++-- src/Plugins/ITKImageProcessing/CMakeLists.txt | 4 ++-- src/Plugins/OrientationAnalysis/CMakeLists.txt | 4 ++-- src/Plugins/OrientationAnalysis/test/CMakeLists.txt | 2 +- 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3538c206be..8541b23ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -807,17 +807,10 @@ set(COMPLEX_PACKAGE_NAMESPACE "complex::") #------------------------------------------------------------------------------ # Install the appropriate example pipelines based on which plugins are loaded #------------------------------------------------------------------------------ -set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/Data") +set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/Data") file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM) -set(PIPELINE_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/pipelines") -if(NOT EXISTS "${PIPELINE_DEST_DIR}") - file(MAKE_DIRECTORY ${PIPELINE_DEST_DIR}) -endif() - +set(PIPELINE_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/pipelines") set(PIPELINE_EXAMPLES_DEST_DIR "${PIPELINE_DEST_DIR}/Examples") -if(NOT EXISTS "${PIPELINE_EXAMPLES_DEST_DIR}") - file(MAKE_DIRECTORY ${PIPELINE_EXAMPLES_DEST_DIR}) -endif() if(COMPLEX_DOWNLOAD_TEST_FILES AND TARGET ComplexCore AND TARGET ITKImageProcessing AND TARGET OrientationAnalysis) add_custom_target(Copy_PorosityAnalysis_Pipelines ALL diff --git a/cmake/Utility.cmake b/cmake/Utility.cmake index 0a58508c7e..fd7ecafdf4 100644 --- a/cmake/Utility.cmake +++ b/cmake/Utility.cmake @@ -110,8 +110,7 @@ function(download_test_data) # Create the custom CMake File for this archive file #---------------------------------------------------------------------------- set(fetch_data_file "${test_files_dir}/${ARGS_ARCHIVE_NAME}.cmake") - set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/Data") - file(MAKE_DIRECTORY "${DATA_DEST_DIR}") + set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/Data") # Strip off the .tar.gz extension string(REPLACE ".tar.gz" "" ARCHIVE_BASE_NAME "${ARGS_ARCHIVE_NAME}") @@ -126,8 +125,6 @@ function(download_test_data) file(REMOVE "${fetch_data_file}") # Remove the temporary file if(ARGS_COPY_DATA) - set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/Data") - configure_file(${complex_SOURCE_DIR}/cmake/CopyDataFile.cmake.in ${fetch_data_file} @ONLY @@ -146,7 +143,6 @@ function(download_test_data) if(ARGS_INSTALL) # If we did NOT already copy the data, then do that now during the build if(NOT ARGS_COPY_DATA) - set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/Data") configure_file(${complex_SOURCE_DIR}/cmake/CopyDataFile.cmake.in ${fetch_data_file} @ONLY @@ -183,7 +179,7 @@ function(create_data_copy_rules) endif() - set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/Data/") + set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/Data/") if(EXISTS "${ARGS_DREAM3D_DATA_DIR}/Data") add_custom_target(DataFolderCopy ALL COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARGS_DREAM3D_DATA_DIR}/Data ${DATA_DEST_DIR} diff --git a/src/Plugins/ComplexCore/CMakeLists.txt b/src/Plugins/ComplexCore/CMakeLists.txt index f3fa19f425..d9c3619d40 100644 --- a/src/Plugins/ComplexCore/CMakeLists.txt +++ b/src/Plugins/ComplexCore/CMakeLists.txt @@ -346,7 +346,7 @@ source_group(TREE "${${PLUGIN_NAME}_SOURCE_DIR}/src/${PLUGIN_NAME}" PREFIX ${PLU # Install example pipelines # ----------------------------------------------------------------------- if(EXISTS "${${PLUGIN_NAME}_SOURCE_DIR}/pipelines") - set(PIPELINE_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/pipelines/${PLUGIN_NAME}") + set(PIPELINE_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/pipelines/${PLUGIN_NAME}") add_custom_target(Copy_${PLUGIN_NAME}_Pipeline_Folder ALL COMMAND ${CMAKE_COMMAND} -E copy_directory "${${PLUGIN_NAME}_SOURCE_DIR}/pipelines" ${PIPELINE_DEST_DIR} @@ -369,7 +369,7 @@ endif() # Download Example Data Files # ----------------------------------------------------------------------- include(${complex_SOURCE_DIR}/cmake/Utility.cmake) -set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/Data") +set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/Data") file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM) diff --git a/src/Plugins/ITKImageProcessing/CMakeLists.txt b/src/Plugins/ITKImageProcessing/CMakeLists.txt index 253327df58..d249dc020d 100644 --- a/src/Plugins/ITKImageProcessing/CMakeLists.txt +++ b/src/Plugins/ITKImageProcessing/CMakeLists.txt @@ -320,7 +320,7 @@ endif() # Install example pipelines # ----------------------------------------------------------------------- if(EXISTS "${${PLUGIN_NAME}_SOURCE_DIR}/pipelines") - set(PIPELINE_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/pipelines/${PLUGIN_NAME}") + set(PIPELINE_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/pipelines/${PLUGIN_NAME}") add_custom_target(Copy_${PLUGIN_NAME}_Pipeline_Folder ALL COMMAND ${CMAKE_COMMAND} -E copy_directory "${${PLUGIN_NAME}_SOURCE_DIR}/pipelines" ${PIPELINE_DEST_DIR} @@ -344,7 +344,7 @@ endif() # Download Example Data Files # ----------------------------------------------------------------------- include(${complex_SOURCE_DIR}/cmake/Utility.cmake) -set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/Data") +set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/Data") file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM) diff --git a/src/Plugins/OrientationAnalysis/CMakeLists.txt b/src/Plugins/OrientationAnalysis/CMakeLists.txt index aa64f45d68..115818ed7f 100644 --- a/src/Plugins/OrientationAnalysis/CMakeLists.txt +++ b/src/Plugins/OrientationAnalysis/CMakeLists.txt @@ -274,7 +274,7 @@ endif() # Install example pipelines # ----------------------------------------------------------------------- if(EXISTS "${${PLUGIN_NAME}_SOURCE_DIR}/pipelines") - set(PIPELINE_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/pipelines/${PLUGIN_NAME}") + set(PIPELINE_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/pipelines/${PLUGIN_NAME}") add_custom_target(Copy_${PLUGIN_NAME}_Pipeline_Folder ALL COMMAND ${CMAKE_COMMAND} -E copy_directory "${${PLUGIN_NAME}_SOURCE_DIR}/pipelines" ${PIPELINE_DEST_DIR} @@ -297,7 +297,7 @@ endif() # Download Example Data Files # ----------------------------------------------------------------------- include(${complex_SOURCE_DIR}/cmake/Utility.cmake) -set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/Data") +set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/Data") file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM) diff --git a/src/Plugins/OrientationAnalysis/test/CMakeLists.txt b/src/Plugins/OrientationAnalysis/test/CMakeLists.txt index 9d22143da8..954cad85f9 100644 --- a/src/Plugins/OrientationAnalysis/test/CMakeLists.txt +++ b/src/Plugins/OrientationAnalysis/test/CMakeLists.txt @@ -187,7 +187,7 @@ function(add_pipeline_test) if(WIN32) set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/%CONFIG_DIR%/") else() - set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/") + set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$/") endif() foreach ( f ${ARGS_DELETE_FILE_LIST})