Skip to content

Commit

Permalink
Replaced CMAKE_CFG_INTDIR with $<CONFIG>
Browse files Browse the repository at this point in the history
* CMAKE_CFG_INTDIR is deprecated
* Fixes packaging with Visual Studio generator
* Removed file(MAKE_DIRECTORY) calls that use variables with
$<CONFIG> since it can't use generator expressions and the calls
aren't required

Signed-off-by: Jared Duffey <[email protected]>
  • Loading branch information
JDuffeyBQ authored and imikejackson committed Sep 29, 2023
1 parent aa3a843 commit 9345841
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 22 deletions.
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}/$<CONFIG>/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}/$<CONFIG>/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
Expand Down
8 changes: 2 additions & 6 deletions cmake/Utility.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}/$<CONFIG>/Data")
# Strip off the .tar.gz extension
string(REPLACE ".tar.gz" "" ARCHIVE_BASE_NAME "${ARGS_ARCHIVE_NAME}")

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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}/$<CONFIG>/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}
Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/ComplexCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}/$<CONFIG>/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}
Expand All @@ -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}/$<CONFIG>/Data")

file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM)

Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/ITKImageProcessing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}/$<CONFIG>/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}
Expand All @@ -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}/$<CONFIG>/Data")

file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM)

Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/OrientationAnalysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}/$<CONFIG>/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}
Expand All @@ -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}/$<CONFIG>/Data")

file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM)

Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/OrientationAnalysis/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}/$<CONFIG>/")
endif()

foreach ( f ${ARGS_DELETE_FILE_LIST})
Expand Down

0 comments on commit 9345841

Please sign in to comment.