Skip to content

Commit

Permalink
ENH: Replaced CMAKE_CFG_INTDIR with $<CONFIG> (#687)
Browse files Browse the repository at this point in the history
* Replaced CMAKE_CFG_INTDIR with $<CONFIG>
* 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
* Use $<CONFIG> or "." depending if the generator is multi-config
* Visual Studio fixes build, install, help generation
* Single and multi-config install rule fixes

---------

Signed-off-by: Jared Duffey <[email protected]>
Signed-off-by: Michael Jackson <[email protected]>
Co-authored-by: Michael Jackson <[email protected]>
  • Loading branch information
JDuffeyBQ and imikejackson authored Oct 16, 2023
1 parent 0f7c234 commit 677ddc6
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 30 deletions.
26 changes: 16 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ file(WRITE ${FETCH_FILE_PATH} "# -----------------------------------------------
# ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>
# -----------------------------------------------------------------------\n
cmake_policy(SET CMP0012 NEW)
cmake_policy(SET CMP0054 NEW)\n")
cmake_policy(SET CMP0054 NEW)\n
message(STATUS \"CMAKE_CONFIG=\${CMAKE_CONFIG}\")
")

set(TEST_WORKING_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
if(CMAKE_GENERATOR MATCHES "Visual Studio")
Expand All @@ -112,7 +114,7 @@ endif()

if(COMPLEX_BUILD_TESTS AND COMPLEX_DOWNLOAD_TEST_FILES)
add_custom_target(Fetch_Remote_Data_Files ALL
COMMAND "${CMAKE_COMMAND}" -P "${FETCH_FILE_PATH}"
COMMAND "${CMAKE_COMMAND}" -DCMAKE_CONFIG=$<CONFIG> -P "${FETCH_FILE_PATH}"
COMMENT "Downloading Test Data Files"
# WORKING_DIRECTORY "${TEST_WORKING_DIR}"
)
Expand Down Expand Up @@ -808,29 +810,31 @@ 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")
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})
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(is_multi_config)
set(CX_CONFIG_DIR "$<CONFIG>")
else()
set(CX_CONFIG_DIR ".")
endif()

set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CX_CONFIG_DIR}/Data")
file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM)
set(PIPELINE_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CX_CONFIG_DIR}/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
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${complex_SOURCE_DIR}/pipelines/PorosityAnalysis.d3dpipeline" "${PIPELINE_EXAMPLES_DEST_DIR}/PorosityAnalysis.d3dpipeline"
COMMENT "Copying Example Pipelines into Binary Directory"
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_PorosityAnalysis_Pipelines PROPERTIES FOLDER ZZ_COPY_FILES)

add_custom_target(Copy_CAxis_Pipelines ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${complex_SOURCE_DIR}/pipelines/Combo-EBSD-osc_r0c0.d3dpipeline" "${PIPELINE_EXAMPLES_DEST_DIR}/Combo-EBSD-osc_r0c0.d3dpipeline"
COMMENT "Copying Example Pipelines into Binary Directory"
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_CAxis_Pipelines PROPERTIES FOLDER ZZ_COPY_FILES)
Expand All @@ -843,6 +847,8 @@ if(COMPLEX_DOWNLOAD_TEST_FILES AND TARGET ComplexCore AND TARGET ITKImageProcess
WORKING_DIRECTORY "${DREAM3D_DATA_DIR}/TestFiles"
COMMENT "[DATA EXTRACT/COPY] 6_6_caxis_data into Binary Directory"
DEPENDS Fetch_Remote_Data_Files # Make sure all remote files are downloaded before trying this
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_CAxis_Data PROPERTIES FOLDER ZZ_COPY_FILES)
endif()
Expand Down
5 changes: 4 additions & 1 deletion cmake/CopyDataFile.cmake.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# --------------------------------------------------------------------------------------------------
# message(STATUS "[DATA COPY] Copy data from @ARGS_DREAM3D_DATA_DIR@/TestFiles/@ARCHIVE_BASE_NAME@")
# --------------------------------------------------------------------------------------------------
# execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "@ARGS_DREAM3D_DATA_DIR@/TestFiles/@ARCHIVE_BASE_NAME@" "Data/@ARCHIVE_BASE_NAME@")
# execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "@ARGS_DREAM3D_DATA_DIR@/TestFiles/@ARCHIVE_BASE_NAME@" "Data/@ARCHIVE_BASE_NAME@"
# COMMAND_EXPAND_LISTS
# VERBATIM
# )
32 changes: 25 additions & 7 deletions cmake/Utility.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,15 @@ function(download_test_data)
#----------------------------------------------------------------------------
# Create the custom CMake File for this archive file
#----------------------------------------------------------------------------
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(is_multi_config)
set(CX_CONFIG_DIR "\${CONFIG}")
else()
set(CX_CONFIG_DIR ".")
endif()
set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CX_CONFIG_DIR}/Data")

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}")
# Strip off the .tar.gz extension
string(REPLACE ".tar.gz" "" ARCHIVE_BASE_NAME "${ARGS_ARCHIVE_NAME}")

Expand All @@ -126,8 +132,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 +150,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 All @@ -156,6 +159,12 @@ function(download_test_data)
file(REMOVE "${fetch_data_file}")
endif()

if(is_multi_config)
set(CX_CONFIG_DIR "$<CONFIG>")
else()
set(CX_CONFIG_DIR ".")
endif()
set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CX_CONFIG_DIR}/Data")
install(DIRECTORY
"${DATA_DEST_DIR}/${ARCHIVE_BASE_NAME}"
DESTINATION Data/
Expand All @@ -182,12 +191,21 @@ function(create_data_copy_rules)
return()
endif()

get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(is_multi_config)
set(CX_CONFIG_DIR "$<CONFIG>")
else()
set(CX_CONFIG_DIR ".")
endif()

set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/Data/")
set(DATA_DEST_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CX_CONFIG_DIR}/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}
COMMENT "Copying Data Folder into Binary Directory")
COMMENT "Copying Data Folder into Binary Directory"
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(DataFolderCopy PROPERTIES FOLDER ZZ_COPY_FILES)

set(DREAM3D_DATA_DIRECTORIES
Expand Down
25 changes: 20 additions & 5 deletions src/Plugins/ComplexCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,23 @@ source_group(TREE "${${PLUGIN_NAME}_SOURCE_DIR}/src/${PLUGIN_NAME}" PREFIX ${PLU
# -----------------------------------------------------------------------
# Install example pipelines
# -----------------------------------------------------------------------
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(is_multi_config)
set(CX_CONFIG_DIR "$<CONFIG>")
else()
set(CX_CONFIG_DIR ".")
endif()


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}/${CX_CONFIG_DIR}/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}
COMMENT "Copying Pipeline Folder into Binary Directory")
COMMENT "Copying Pipeline Folder into Binary Directory"
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_Pipeline_Folder PROPERTIES FOLDER Plugins/${PLUGIN_NAME})

option(${PLUGIN_NAME}_INSTALL_PIPELINES "Enables install of ${PLUGIN_NAME} pipelines" ON)
Expand All @@ -369,7 +380,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}/${CX_CONFIG_DIR}/Data")

file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM)

Expand All @@ -390,11 +401,13 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND COMPLEX_DOWNLOAD_TEST_FILES)
)
add_custom_target(Copy_${PLUGIN_NAME}_ASCIIData ALL
COMMAND ${CMAKE_COMMAND} -E tar xzf "${DREAM3D_DATA_DIR}/TestFiles/ASCIIData.tar.gz"
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different "${DREAM3D_DATA_DIR}/TestFiles/ASCIIData" "${DATA_DEST_DIR}/ASCIIData"
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different "${DREAM3D_DATA_DIR}/TestFiles/ASCIIData" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CX_CONFIG_DIR}/Data/ASCIIData"
COMMAND ${CMAKE_COMMAND} -E rm -rf "${DREAM3D_DATA_DIR}/TestFiles/ASCIIData"
WORKING_DIRECTORY "${DREAM3D_DATA_DIR}/TestFiles"
COMMENT "Copying ${PLUGIN_NAME}/ASCIIData data into Binary Directory"
DEPENDS Fetch_Remote_Data_Files # Make sure all remote files are downloaded before trying this
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_ASCIIData PROPERTIES FOLDER Plugins/${PLUGIN_NAME})

Expand All @@ -406,11 +419,13 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND COMPLEX_DOWNLOAD_TEST_FILES)
)
add_custom_target(Copy_${PLUGIN_NAME}_STL_Models ALL
COMMAND ${CMAKE_COMMAND} -E tar xzf "${DREAM3D_DATA_DIR}/TestFiles/STL_Models.tar.gz"
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different "${DREAM3D_DATA_DIR}/TestFiles/STL_Models" "${DATA_DEST_DIR}/STL_Models"
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different "${DREAM3D_DATA_DIR}/TestFiles/STL_Models" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CX_CONFIG_DIR}/Data/STL_Models"
COMMAND ${CMAKE_COMMAND} -E rm -rf "${DREAM3D_DATA_DIR}/TestFiles/STL_Models"
WORKING_DIRECTORY "${DREAM3D_DATA_DIR}/TestFiles"
COMMENT "Copying ${PLUGIN_NAME}/STL_Models data into Binary Directory"
DEPENDS Fetch_Remote_Data_Files # Make sure all remote files are downloaded before trying this
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_STL_Models PROPERTIES FOLDER Plugins/${PLUGIN_NAME})

Expand Down
17 changes: 15 additions & 2 deletions src/Plugins/ITKImageProcessing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,21 @@ endif()
# -----------------------------------------------------------------------
# Install example pipelines
# -----------------------------------------------------------------------
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(is_multi_config)
set(CX_CONFIG_DIR "$<CONFIG>")
else()
set(CX_CONFIG_DIR ".")
endif()

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}/${CX_CONFIG_DIR}/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}
COMMENT "Copying Pipeline Folder into Binary Directory"
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_Pipeline_Folder PROPERTIES FOLDER Plugins/${PLUGIN_NAME})

Expand All @@ -346,7 +355,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}/${CX_CONFIG_DIR}/Data")

file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM)

Expand Down Expand Up @@ -376,6 +385,8 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND COMPLEX_DOWNLOAD_TEST_FILES)
WORKING_DIRECTORY "${DREAM3D_DATA_DIR}/TestFiles"
COMMENT "Copying ${PLUGIN_NAME}/Porosity_Image data into Binary Directory"
DEPENDS Fetch_Remote_Data_Files # Make sure all remote files are downloaded before trying this
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_Porosity_Image PROPERTIES FOLDER Plugins/${PLUGIN_NAME})
endif()
Expand All @@ -390,6 +401,8 @@ if(FALSE)
add_custom_target(Copy_${PLUGIN_NAME}_Data ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${${PLUGIN_NAME}_SOURCE_DIR}/data ${DATA_DEST_DIR}/${PLUGIN_NAME}
COMMENT "Copying ${PLUGIN_NAME} data into Binary Directory"
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_Data PROPERTIES FOLDER Plugins/${PLUGIN_NAME})

Expand Down
28 changes: 24 additions & 4 deletions src/Plugins/OrientationAnalysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,22 @@ endif()
# -----------------------------------------------------------------------
# Install example pipelines
# -----------------------------------------------------------------------
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(is_multi_config)
set(CX_CONFIG_DIR "$<CONFIG>")
else()
set(CX_CONFIG_DIR ".")
endif()

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}/${CX_CONFIG_DIR}/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}
COMMENT "Copying Pipeline Folder into Binary Directory")
COMMENT "Copying Pipeline Folder into Binary Directory"
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_Pipeline_Folder PROPERTIES FOLDER Plugins/${PLUGIN_NAME})

option(${PLUGIN_NAME}_INSTALL_PIPELINES "Enables install of ${PLUGIN_NAME} pipelines" ON)
Expand All @@ -297,7 +307,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}/${CX_CONFIG_DIR}/Data")

file(TO_CMAKE_PATH "${DREAM3D_DATA_DIR}" DREAM3D_DATA_DIR_NORM)

Expand All @@ -322,6 +332,8 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND COMPLEX_DOWNLOAD_TEST_FILES)
WORKING_DIRECTORY "${DREAM3D_DATA_DIR}/TestFiles"
COMMENT "Copying ${PLUGIN_NAME}/T12-MAI-2010 data into Binary Directory"
DEPENDS Fetch_Remote_Data_Files # Make sure all remote files are downloaded before trying this
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_T12-MAI-2010 PROPERTIES FOLDER Plugins/${PLUGIN_NAME})

Expand All @@ -337,6 +349,8 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND COMPLEX_DOWNLOAD_TEST_FILES)
WORKING_DIRECTORY "${DREAM3D_DATA_DIR}/TestFiles"
COMMENT "Copying ${PLUGIN_NAME}/Textured_Copper data into Binary Directory"
DEPENDS Fetch_Remote_Data_Files # Make sure all remote files are downloaded before trying this
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_Textured_Copper PROPERTIES FOLDER Plugins/${PLUGIN_NAME})

Expand All @@ -351,6 +365,8 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND COMPLEX_DOWNLOAD_TEST_FILES)
WORKING_DIRECTORY "${DREAM3D_DATA_DIR}/TestFiles"
COMMENT "Copying ${PLUGIN_NAME}/Small_IN100 data into Binary Directory"
DEPENDS Fetch_Remote_Data_Files # Make sure all remote files are downloaded before trying this
COMMAND_EXPAND_LISTS
VERBATIM
)

download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR}
Expand All @@ -364,6 +380,8 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND COMPLEX_DOWNLOAD_TEST_FILES)
WORKING_DIRECTORY "${DREAM3D_DATA_DIR}/TestFiles"
COMMENT "Copying ${PLUGIN_NAME} data into Binary Directory"
DEPENDS Fetch_Remote_Data_Files # Make sure all remote files are downloaded before trying this
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_H5Data PROPERTIES FOLDER ZZ_COPY_FILES)
endif()
Expand All @@ -375,7 +393,9 @@ endif()
add_custom_target(Copy_${PLUGIN_NAME}_Data ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${${PLUGIN_NAME}_SOURCE_DIR}/data ${DATA_DEST_DIR}/${PLUGIN_NAME}
COMMENT "Copying ${PLUGIN_NAME} data into Binary Directory"
)
COMMAND_EXPAND_LISTS
VERBATIM
)
set_target_properties(Copy_${PLUGIN_NAME}_Data PROPERTIES FOLDER Plugins/${PLUGIN_NAME})

option(${PLUGIN_NAME}_INSTALL_DATA_FILES "Enables install of ${PLUGIN_NAME} data files" ON)
Expand Down
10 changes: 9 additions & 1 deletion src/Plugins/OrientationAnalysis/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,18 @@ function(add_pipeline_test)
set(COMPLEX_CTEST_TEST_DRIVER "${${PLUGIN_NAME}_BINARY_DIR}/PrebuiltPipelineTests/${test}.${TEST_SCRIPT_FILE_EXT}")
# message(STATUS "==> ${COMPLEX_CTEST_TEST_DRIVER}")
set(DELETE_FILE_COMMANDS "")

get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(is_multi_config)
set(CX_CONFIG_DIR "$<CONFIG>")
else()
set(CX_CONFIG_DIR ".")
endif()

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}/${CX_CONFIG_DIR}/")
endif()

foreach ( f ${ARGS_DELETE_FILE_LIST})
Expand Down

0 comments on commit 677ddc6

Please sign in to comment.