diff --git a/ExampleAnalysis/CMakeLists.txt b/ExampleAnalysis/CMakeLists.txt index c3cc30c..2ab6d7d 100644 --- a/ExampleAnalysis/CMakeLists.txt +++ b/ExampleAnalysis/CMakeLists.txt @@ -23,10 +23,12 @@ endif(MSVC) # ----------------------------------------------------------------------------- # Set install directory # ----------------------------------------------------------------------------- -# Get the env path and allow the user to change it -set(INSTALL_DIR $ENV{HDPS_INSTALL_DIR} CACHE PATH "The HDPS Install Directoy") -# Normalize the incoming install path -file(TO_CMAKE_PATH ${INSTALL_DIR} INSTALL_DIR) +# Check if the directory to the ManiVault installation has been provided +if(NOT DEFINED MV_INSTALL_DIR) + set(MV_INSTALL_DIR "" CACHE PATH "Directory where ManiVault is installed") + message(FATAL_ERROR "Please set MV_INSTALL_DIR to the directory where ManiVault is installed") +endif() +file(TO_CMAKE_PATH ${MV_INSTALL_DIR} MV_INSTALL_DIR) # ----------------------------------------------------------------------------- # Dependencies @@ -64,7 +66,7 @@ target_sources(${EXAMPLEANALYSIS} PRIVATE ${EXAMPLEANALYSIS_MOC}) # Target include directories # ----------------------------------------------------------------------------- # Include HDPS headers, including system data plugins -target_include_directories(${EXAMPLEANALYSIS} PRIVATE "${INSTALL_DIR}/$/include/") +target_include_directories(${EXAMPLEANALYSIS} PRIVATE "${MV_INSTALL_DIR}/$/include/") # ----------------------------------------------------------------------------- # Target properties @@ -83,8 +85,8 @@ target_link_libraries(${EXAMPLEANALYSIS} PRIVATE Qt6::WebEngineWidgets) # The link path in this repo assumes that the ManiVault core was built locally # in contrast to having been installed with an installer. In the latter case you'll have # to adapt the HDPS_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(HDPS_LINK_PATH "${INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${INSTALL_DIR}/$/$,lib,Plugins>") +set(HDPS_LINK_PATH "${MV_INSTALL_DIR}/$/lib") +set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") set(HDPS_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) set(HDPS_LINK_LIBRARY "${HDPS_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HDPS_Public${HDPS_LINK_SUFFIX}") @@ -106,7 +108,7 @@ add_custom_command(TARGET ${EXAMPLEANALYSIS} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${INSTALL_DIR}/$ + --prefix ${MV_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -114,6 +116,6 @@ add_custom_command(TARGET ${EXAMPLEANALYSIS} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${EXAMPLEANALYSIS} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${INSTALL_DIR}/debug,${INSTALL_DIR}/release>) - set_property(TARGET ${EXAMPLEANALYSIS} PROPERTY VS_DEBUGGER_COMMAND $,${INSTALL_DIR}/debug/HDPS.exe,${INSTALL_DIR}/release/HDPS.exe>) + set_property(TARGET ${EXAMPLEANALYSIS} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) + set_property(TARGET ${EXAMPLEANALYSIS} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/HDPS.exe,${MV_INSTALL_DIR}/release/HDPS.exe>) endif() diff --git a/ExampleData/CMakeLists.txt b/ExampleData/CMakeLists.txt index 581dc2c..357c381 100644 --- a/ExampleData/CMakeLists.txt +++ b/ExampleData/CMakeLists.txt @@ -23,10 +23,12 @@ endif(MSVC) # ----------------------------------------------------------------------------- # Set install directory # ----------------------------------------------------------------------------- -# Get the env path and allow the user to change it -set(INSTALL_DIR $ENV{HDPS_INSTALL_DIR} CACHE PATH "The HDPS Install Directoy") -# Normalize the incoming install path -file(TO_CMAKE_PATH ${INSTALL_DIR} INSTALL_DIR) +# Check if the directory to the ManiVault installation has been provided +if(NOT DEFINED MV_INSTALL_DIR) + set(MV_INSTALL_DIR "" CACHE PATH "Directory where ManiVault is installed") + message(FATAL_ERROR "Please set MV_INSTALL_DIR to the directory where ManiVault is installed") +endif() +file(TO_CMAKE_PATH ${MV_INSTALL_DIR} MV_INSTALL_DIR) # ----------------------------------------------------------------------------- # Dependencies @@ -62,7 +64,7 @@ target_sources(${EXAMPLEDATA} PRIVATE ${EXAMPLEDATA_MOC}) # Target include directories # ----------------------------------------------------------------------------- # Include HDPS headers, including system data plugins -target_include_directories(${EXAMPLEDATA} PRIVATE "${INSTALL_DIR}/$/include/") +target_include_directories(${EXAMPLEDATA} PRIVATE "${MV_INSTALL_DIR}/$/include/") # ----------------------------------------------------------------------------- # Target properties @@ -83,8 +85,8 @@ target_link_libraries(${EXAMPLEDATA} PRIVATE Qt6::WebEngineWidgets) # The link path in this repo assumes that the ManiVault core was built locally # in contrast to having been installed with an installer. In the latter case you'll have # to adapt the HDPS_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(HDPS_LINK_PATH "${INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${INSTALL_DIR}/$/$,lib,Plugins>") +set(HDPS_LINK_PATH "${MV_INSTALL_DIR}/$/lib") +set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") set(HDPS_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) set(HDPS_LINK_LIBRARY "${HDPS_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HDPS_Public${HDPS_LINK_SUFFIX}") @@ -111,7 +113,7 @@ add_custom_command(TARGET ${EXAMPLEDATA} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${INSTALL_DIR}/$ + --prefix ${MV_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -119,6 +121,6 @@ add_custom_command(TARGET ${EXAMPLEDATA} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${EXAMPLEDATA} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${INSTALL_DIR}/debug,${INSTALL_DIR}/release>) - set_property(TARGET ${EXAMPLEDATA} PROPERTY VS_DEBUGGER_COMMAND $,${INSTALL_DIR}/debug/HDPS.exe,${INSTALL_DIR}/release/HDPS.exe>) + set_property(TARGET ${EXAMPLEDATA} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) + set_property(TARGET ${EXAMPLEDATA} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/HDPS.exe,${MV_INSTALL_DIR}/release/HDPS.exe>) endif() diff --git a/ExampleLoader/CMakeLists.txt b/ExampleLoader/CMakeLists.txt index 18bc106..8bc6bd5 100644 --- a/ExampleLoader/CMakeLists.txt +++ b/ExampleLoader/CMakeLists.txt @@ -23,10 +23,12 @@ endif(MSVC) # ----------------------------------------------------------------------------- # Set install directory # ----------------------------------------------------------------------------- -# Get the env path and allow the user to change it -set(INSTALL_DIR $ENV{HDPS_INSTALL_DIR} CACHE PATH "The HDPS Install Directoy") -# Normalize the incoming install path -file(TO_CMAKE_PATH ${INSTALL_DIR} INSTALL_DIR) +# Check if the directory to the ManiVault installation has been provided +if(NOT DEFINED MV_INSTALL_DIR) + set(MV_INSTALL_DIR "" CACHE PATH "Directory where ManiVault is installed") + message(FATAL_ERROR "Please set MV_INSTALL_DIR to the directory where ManiVault is installed") +endif() +file(TO_CMAKE_PATH ${MV_INSTALL_DIR} MV_INSTALL_DIR) # ----------------------------------------------------------------------------- # Dependencies @@ -62,7 +64,7 @@ target_sources(${EXAMPLELOADER} PRIVATE ${EXAMPLELOADER_MOC}) # Target include directories # ----------------------------------------------------------------------------- # Include HDPS headers, including system data plugins -target_include_directories(${EXAMPLELOADER} PRIVATE "${INSTALL_DIR}/$/include/") +target_include_directories(${EXAMPLELOADER} PRIVATE "${MV_INSTALL_DIR}/$/include/") # ----------------------------------------------------------------------------- # Target properties @@ -81,8 +83,8 @@ target_link_libraries(${EXAMPLELOADER} PRIVATE Qt6::WebEngineWidgets) # The link path in this repo assumes that the ManiVault core was built locally # in contrast to having been installed with an installer. In the latter case you'll have # to adapt the HDPS_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(HDPS_LINK_PATH "${INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${INSTALL_DIR}/$/$,lib,Plugins>") +set(HDPS_LINK_PATH "${MV_INSTALL_DIR}/$/lib") +set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") set(HDPS_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) set(HDPS_LINK_LIBRARY "${HDPS_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HDPS_Public${HDPS_LINK_SUFFIX}") @@ -104,7 +106,7 @@ add_custom_command(TARGET ${EXAMPLELOADER} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${INSTALL_DIR}/$ + --prefix ${MV_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -113,6 +115,6 @@ add_custom_command(TARGET ${EXAMPLELOADER} POST_BUILD # Automatically set the debug environment (command + working directory) for MSVC # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${EXAMPLELOADER} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${INSTALL_DIR}/debug,${INSTALL_DIR}/release>) - set_property(TARGET ${EXAMPLELOADER} PROPERTY VS_DEBUGGER_COMMAND $,${INSTALL_DIR}/debug/HDPS.exe,${INSTALL_DIR}/release/HDPS.exe>) + set_property(TARGET ${EXAMPLELOADER} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) + set_property(TARGET ${EXAMPLELOADER} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/HDPS.exe,${MV_INSTALL_DIR}/release/HDPS.exe>) endif() diff --git a/ExampleTransformation/CMakeLists.txt b/ExampleTransformation/CMakeLists.txt index 043d2d4..7341882 100644 --- a/ExampleTransformation/CMakeLists.txt +++ b/ExampleTransformation/CMakeLists.txt @@ -23,10 +23,12 @@ endif(MSVC) # ----------------------------------------------------------------------------- # Set install directory # ----------------------------------------------------------------------------- -# Get the env path and allow the user to change it -set(INSTALL_DIR $ENV{HDPS_INSTALL_DIR} CACHE PATH "The HDPS Install Directoy") -# Normalize the incoming install path -file(TO_CMAKE_PATH ${INSTALL_DIR} INSTALL_DIR) +# Check if the directory to the ManiVault installation has been provided +if(NOT DEFINED MV_INSTALL_DIR) + set(MV_INSTALL_DIR "" CACHE PATH "Directory where ManiVault is installed") + message(FATAL_ERROR "Please set MV_INSTALL_DIR to the directory where ManiVault is installed") +endif() +file(TO_CMAKE_PATH ${MV_INSTALL_DIR} MV_INSTALL_DIR) # ----------------------------------------------------------------------------- # Dependencies @@ -62,7 +64,7 @@ target_sources(${EXAMPLETRANSFORMATION} PRIVATE ${EXAMPLETRANSFORMATION_MOC}) # Target include directories # ----------------------------------------------------------------------------- # Include HDPS headers, including system data plugins -target_include_directories(${EXAMPLETRANSFORMATION} PRIVATE "${INSTALL_DIR}/$/include/") +target_include_directories(${EXAMPLETRANSFORMATION} PRIVATE "${MV_INSTALL_DIR}/$/include/") # ----------------------------------------------------------------------------- # Target properties @@ -81,8 +83,8 @@ target_link_libraries(${EXAMPLETRANSFORMATION} PRIVATE Qt6::WebEngineWidgets) # The link path in this repo assumes that the ManiVault core was built locally # in contrast to having been installed with an installer. In the latter case you'll have # to adapt the HDPS_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(HDPS_LINK_PATH "${INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${INSTALL_DIR}/$/$,lib,Plugins>") +set(HDPS_LINK_PATH "${MV_INSTALL_DIR}/$/lib") +set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") set(HDPS_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) set(HDPS_LINK_LIBRARY "${HDPS_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HDPS_Public${HDPS_LINK_SUFFIX}") @@ -104,7 +106,7 @@ add_custom_command(TARGET ${EXAMPLETRANSFORMATION} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${INSTALL_DIR}/$ + --prefix ${MV_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -112,6 +114,6 @@ add_custom_command(TARGET ${EXAMPLETRANSFORMATION} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${EXAMPLETRANSFORMATION} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${INSTALL_DIR}/debug,${INSTALL_DIR}/release>) - set_property(TARGET ${EXAMPLETRANSFORMATION} PROPERTY VS_DEBUGGER_COMMAND $,${INSTALL_DIR}/debug/HDPS.exe,${INSTALL_DIR}/release/HDPS.exe>) + set_property(TARGET ${EXAMPLETRANSFORMATION} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) + set_property(TARGET ${EXAMPLETRANSFORMATION} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/HDPS.exe,${MV_INSTALL_DIR}/release/HDPS.exe>) endif() diff --git a/ExampleView/CMakeLists.txt b/ExampleView/CMakeLists.txt index bda23ef..a543224 100644 --- a/ExampleView/CMakeLists.txt +++ b/ExampleView/CMakeLists.txt @@ -23,10 +23,12 @@ endif(MSVC) # ----------------------------------------------------------------------------- # Set install directory # ----------------------------------------------------------------------------- -# Get the env path and allow the user to change it -set(INSTALL_DIR $ENV{HDPS_INSTALL_DIR} CACHE PATH "The HDPS Install Directoy") -# Normalize the incoming install path -file(TO_CMAKE_PATH ${INSTALL_DIR} INSTALL_DIR) +# Check if the directory to the ManiVault installation has been provided +if(NOT DEFINED MV_INSTALL_DIR) + set(MV_INSTALL_DIR "" CACHE PATH "Directory where ManiVault is installed") + message(FATAL_ERROR "Please set MV_INSTALL_DIR to the directory where ManiVault is installed") +endif() +file(TO_CMAKE_PATH ${MV_INSTALL_DIR} MV_INSTALL_DIR) # ----------------------------------------------------------------------------- # Dependencies @@ -62,7 +64,7 @@ target_sources(${EXAMPLEVIEW} PRIVATE ${EXAMPLEVIEW_MOC}) # Target include directories # ----------------------------------------------------------------------------- # Include HDPS headers, including system data plugins -target_include_directories(${EXAMPLEVIEW} PRIVATE "${INSTALL_DIR}/$/include/") +target_include_directories(${EXAMPLEVIEW} PRIVATE "${MV_INSTALL_DIR}/$/include/") # ----------------------------------------------------------------------------- # Target properties @@ -81,8 +83,8 @@ target_link_libraries(${EXAMPLEVIEW} PRIVATE Qt6::WebEngineWidgets) # The link path in this repo assumes that the ManiVault core was built locally # in contrast to having been installed with an installer. In the latter case you'll have # to adapt the HDPS_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(HDPS_LINK_PATH "${INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${INSTALL_DIR}/$/$,lib,Plugins>") +set(HDPS_LINK_PATH "${MV_INSTALL_DIR}/$/lib") +set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") set(HDPS_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) set(HDPS_LINK_LIBRARY "${HDPS_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HDPS_Public${HDPS_LINK_SUFFIX}") @@ -104,7 +106,7 @@ add_custom_command(TARGET ${EXAMPLEVIEW} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${INSTALL_DIR}/$ + --prefix ${MV_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -112,6 +114,6 @@ add_custom_command(TARGET ${EXAMPLEVIEW} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${EXAMPLEVIEW} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${INSTALL_DIR}/debug,${INSTALL_DIR}/release>) - set_property(TARGET ${EXAMPLEVIEW} PROPERTY VS_DEBUGGER_COMMAND $,${INSTALL_DIR}/debug/HDPS.exe,${INSTALL_DIR}/release/HDPS.exe>) + set_property(TARGET ${EXAMPLEVIEW} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) + set_property(TARGET ${EXAMPLEVIEW} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/HDPS.exe,${MV_INSTALL_DIR}/release/HDPS.exe>) endif() diff --git a/ExampleViewJS/CMakeLists.txt b/ExampleViewJS/CMakeLists.txt index 1a6f42b..61ae434 100644 --- a/ExampleViewJS/CMakeLists.txt +++ b/ExampleViewJS/CMakeLists.txt @@ -23,10 +23,12 @@ endif(MSVC) # ----------------------------------------------------------------------------- # Set install directory # ----------------------------------------------------------------------------- -# Get the env path and allow the user to change it -set(INSTALL_DIR $ENV{HDPS_INSTALL_DIR} CACHE PATH "The HDPS Install Directoy") -# Normalize the incoming install path -file(TO_CMAKE_PATH ${INSTALL_DIR} INSTALL_DIR) +# Check if the directory to the ManiVault installation has been provided +if(NOT DEFINED MV_INSTALL_DIR) + set(MV_INSTALL_DIR "" CACHE PATH "Directory where ManiVault is installed") + message(FATAL_ERROR "Please set MV_INSTALL_DIR to the directory where ManiVault is installed") +endif() +file(TO_CMAKE_PATH ${MV_INSTALL_DIR} MV_INSTALL_DIR) # ----------------------------------------------------------------------------- # Dependencies @@ -81,7 +83,7 @@ target_sources(${EXAMPLEVIEWJS} PRIVATE ${EXAMPLEVIEWJS_MOC}) # Target include directories # ----------------------------------------------------------------------------- # Include HDPS headers, including system data plugins -target_include_directories(${EXAMPLEVIEWJS} PRIVATE "${INSTALL_DIR}/$/include/") +target_include_directories(${EXAMPLEVIEWJS} PRIVATE "${MV_INSTALL_DIR}/$/include/") # ----------------------------------------------------------------------------- # Target properties @@ -100,8 +102,8 @@ target_link_libraries(${EXAMPLEVIEWJS} PRIVATE Qt6::WebEngineWidgets) # The link path in this repo assumes that the ManiVault core was built locally # in contrast to having been installed with an installer. In the latter case you'll have # to adapt the HDPS_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(HDPS_LINK_PATH "${INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${INSTALL_DIR}/$/$,lib,Plugins>") +set(HDPS_LINK_PATH "${MV_INSTALL_DIR}/$/lib") +set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") set(HDPS_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) set(HDPS_LINK_LIBRARY "${HDPS_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HDPS_Public${HDPS_LINK_SUFFIX}") @@ -123,7 +125,7 @@ add_custom_command(TARGET ${EXAMPLEVIEWJS} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${INSTALL_DIR}/$ + --prefix ${MV_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -131,6 +133,6 @@ add_custom_command(TARGET ${EXAMPLEVIEWJS} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${EXAMPLEVIEWJS} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${INSTALL_DIR}/debug,${INSTALL_DIR}/release>) - set_property(TARGET ${EXAMPLEVIEWJS} PROPERTY VS_DEBUGGER_COMMAND $,${INSTALL_DIR}/debug/HDPS.exe,${INSTALL_DIR}/release/HDPS.exe>) + set_property(TARGET ${EXAMPLEVIEWJS} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) + set_property(TARGET ${EXAMPLEVIEWJS} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/HDPS.exe,${MV_INSTALL_DIR}/release/HDPS.exe>) endif() diff --git a/ExampleViewOpenGL/CMakeLists.txt b/ExampleViewOpenGL/CMakeLists.txt index 9dcfdbd..58ae5e8 100644 --- a/ExampleViewOpenGL/CMakeLists.txt +++ b/ExampleViewOpenGL/CMakeLists.txt @@ -23,10 +23,12 @@ endif(MSVC) # ----------------------------------------------------------------------------- # Set install directory # ----------------------------------------------------------------------------- -# Get the env path and allow the user to change it -set(INSTALL_DIR $ENV{HDPS_INSTALL_DIR} CACHE PATH "The HDPS Install Directoy") -# Normalize the incoming install path -file(TO_CMAKE_PATH ${INSTALL_DIR} INSTALL_DIR) +# Check if the directory to the ManiVault installation has been provided +if(NOT DEFINED MV_INSTALL_DIR) + set(MV_INSTALL_DIR "" CACHE PATH "Directory where ManiVault is installed") + message(FATAL_ERROR "Please set MV_INSTALL_DIR to the directory where ManiVault is installed") +endif() +file(TO_CMAKE_PATH ${MV_INSTALL_DIR} MV_INSTALL_DIR) # ----------------------------------------------------------------------------- # Dependencies @@ -74,7 +76,7 @@ target_sources(${EXAMPLEVIEWGL} PRIVATE ${EXAMPLEVIEWGL_MOC}) # Target include directories # ----------------------------------------------------------------------------- # Include HDPS headers, including system data plugins -target_include_directories(${EXAMPLEVIEWGL} PRIVATE "${INSTALL_DIR}/$/include/") +target_include_directories(${EXAMPLEVIEWGL} PRIVATE "${MV_INSTALL_DIR}/$/include/") # ----------------------------------------------------------------------------- # Target properties @@ -95,8 +97,8 @@ target_link_libraries(${EXAMPLEVIEWGL} PRIVATE Qt6::OpenGLWidgets) # The link path in this repo assumes that the ManiVault core was built locally # in contrast to having been installed with an installer. In the latter case you'll have # to adapt the HDPS_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(HDPS_LINK_PATH "${INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${INSTALL_DIR}/$/$,lib,Plugins>") +set(HDPS_LINK_PATH "${MV_INSTALL_DIR}/$/lib") +set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") set(HDPS_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) set(HDPS_LINK_LIBRARY "${HDPS_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HDPS_Public${HDPS_LINK_SUFFIX}") @@ -118,7 +120,7 @@ add_custom_command(TARGET ${EXAMPLEVIEWGL} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${INSTALL_DIR}/$ + --prefix ${MV_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -126,6 +128,6 @@ add_custom_command(TARGET ${EXAMPLEVIEWGL} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${EXAMPLEVIEWGL} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${INSTALL_DIR}/debug,${INSTALL_DIR}/release>) - set_property(TARGET ${EXAMPLEVIEWGL} PROPERTY VS_DEBUGGER_COMMAND $,${INSTALL_DIR}/debug/HDPS.exe,${INSTALL_DIR}/release/HDPS.exe>) + set_property(TARGET ${EXAMPLEVIEWGL} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) + set_property(TARGET ${EXAMPLEVIEWGL} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/HDPS.exe,${MV_INSTALL_DIR}/release/HDPS.exe>) endif() diff --git a/ExampleWriter/CMakeLists.txt b/ExampleWriter/CMakeLists.txt index 0cb3c01..2210d32 100644 --- a/ExampleWriter/CMakeLists.txt +++ b/ExampleWriter/CMakeLists.txt @@ -23,10 +23,12 @@ endif(MSVC) # ----------------------------------------------------------------------------- # Set install directory # ----------------------------------------------------------------------------- -# Get the env path and allow the user to change it -set(INSTALL_DIR $ENV{HDPS_INSTALL_DIR} CACHE PATH "The HDPS Install Directoy") -# Normalize the incoming install path -file(TO_CMAKE_PATH ${INSTALL_DIR} INSTALL_DIR) +# Check if the directory to the ManiVault installation has been provided +if(NOT DEFINED MV_INSTALL_DIR) + set(MV_INSTALL_DIR "" CACHE PATH "Directory where ManiVault is installed") + message(FATAL_ERROR "Please set MV_INSTALL_DIR to the directory where ManiVault is installed") +endif() +file(TO_CMAKE_PATH ${MV_INSTALL_DIR} MV_INSTALL_DIR) # ----------------------------------------------------------------------------- # Dependencies @@ -62,7 +64,7 @@ target_sources(${EXAMPLEWRITER} PRIVATE ${EXAMPLERITER_MOC}) # Target include directories # ----------------------------------------------------------------------------- # Include HDPS headers, including system data plugins -target_include_directories(${EXAMPLEWRITER} PRIVATE "${INSTALL_DIR}/$/include/") +target_include_directories(${EXAMPLEWRITER} PRIVATE "${MV_INSTALL_DIR}/$/include/") # ----------------------------------------------------------------------------- # Target properties @@ -81,8 +83,8 @@ target_link_libraries(${EXAMPLEWRITER} PRIVATE Qt6::WebEngineWidgets) # The link path in this repo assumes that the ManiVault core was built locally # in contrast to having been installed with an installer. In the latter case you'll have # to adapt the HDPS_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(HDPS_LINK_PATH "${INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${INSTALL_DIR}/$/$,lib,Plugins>") +set(HDPS_LINK_PATH "${MV_INSTALL_DIR}/$/lib") +set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") set(HDPS_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) set(HDPS_LINK_LIBRARY "${HDPS_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HDPS_Public${HDPS_LINK_SUFFIX}") @@ -104,7 +106,7 @@ add_custom_command(TARGET ${EXAMPLEWRITER} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${INSTALL_DIR}/$ + --prefix ${MV_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -112,6 +114,6 @@ add_custom_command(TARGET ${EXAMPLEWRITER} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${EXAMPLEWRITER} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${INSTALL_DIR}/debug,${INSTALL_DIR}/release>) - set_property(TARGET ${EXAMPLEWRITER} PROPERTY VS_DEBUGGER_COMMAND $,${INSTALL_DIR}/debug/HDPS.exe,${INSTALL_DIR}/release/HDPS.exe>) + set_property(TARGET ${EXAMPLEWRITER} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) + set_property(TARGET ${EXAMPLEWRITER} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/HDPS.exe,${MV_INSTALL_DIR}/release/HDPS.exe>) endif() diff --git a/README.md b/README.md index bdc8966..d82e2a6 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ git clone https://github.com/ManiVaultStudio/ExamplePlugins.git After unzipping the download file or navigating to the cloned folder, continue with the next step. ## Project setup -You'll need to define a `HDPS_INSTALL_DIR` variable either globally as an environment variable of provide it to CMake, as described in the ManiVault install guide. This variable is used to find your local ManiVault installation and defines an install location for the example plugins. +You'll need to define a `MV_INSTALL_DIR` variable and provide it to CMake, as described in the ManiVault install guide. This variable is used to find your local ManiVault installation and defines an install location for the example plugins. For Windows, using the CMake GUI: 1. Launch CMake (available here: https://cmake.org/)