From 2e6612b59aab0bc921877eba5de59943b81e99f1 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Mon, 13 May 2024 14:56:18 +0200 Subject: [PATCH] Use find_package --- ExampleAnalysis/CMakeLists.txt | 34 +++++++--------------------- ExampleData/CMakeLists.txt | 34 +++++++--------------------- ExampleLoader/CMakeLists.txt | 34 +++++++--------------------- ExampleTransformation/CMakeLists.txt | 34 +++++++--------------------- ExampleView/CMakeLists.txt | 34 +++++++--------------------- ExampleViewJS/CMakeLists.txt | 34 +++++++--------------------- ExampleViewOpenGL/CMakeLists.txt | 34 +++++++--------------------- ExampleWriter/CMakeLists.txt | 34 +++++++--------------------- conanfile.py | 4 ++++ 9 files changed, 68 insertions(+), 208 deletions(-) diff --git a/ExampleAnalysis/CMakeLists.txt b/ExampleAnalysis/CMakeLists.txt index 6785c5a..9001424 100644 --- a/ExampleAnalysis/CMakeLists.txt +++ b/ExampleAnalysis/CMakeLists.txt @@ -21,21 +21,13 @@ if(MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif(MSVC) -# ----------------------------------------------------------------------------- -# Set install directory -# ----------------------------------------------------------------------------- -# 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 # ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED) +find_package(ManiVault COMPONENTS Core PointData CONFIG) + # ----------------------------------------------------------------------------- # Source files # ----------------------------------------------------------------------------- @@ -64,7 +56,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES}) # Target include directories # ----------------------------------------------------------------------------- # Include ManiVault headers, including system data plugins -target_include_directories(${PROJECT_NAME} PRIVATE "${MV_INSTALL_DIR}/$/include/") +target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}") # ----------------------------------------------------------------------------- # Target properties @@ -85,18 +77,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::WebEngineWidgets) # Link to ManiVault and data plugins -# 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 MV_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(MV_LINK_PATH "${MV_INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") -set(MV_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) - -set(MV_LINK_LIBRARY "${MV_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}MV_Public${MV_LINK_SUFFIX}") -set(POINTDATA_LINK_LIBRARY "${PLUGIN_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}PointData${MV_LINK_SUFFIX}") - -target_link_libraries(${PROJECT_NAME} PRIVATE "${MV_LINK_LIBRARY}") -target_link_libraries(${PROJECT_NAME} PRIVATE "${POINTDATA_LINK_LIBRARY}") +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::Core) +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::PointData) # ----------------------------------------------------------------------------- # Target installation @@ -111,7 +93,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${MV_INSTALL_DIR}/$ + --prefix ${ManiVault_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -119,6 +101,6 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${MV_INSTALL_DIR}/release/ManiVault\ Studio.exe>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>) endif() diff --git a/ExampleData/CMakeLists.txt b/ExampleData/CMakeLists.txt index 0db457a..106849a 100644 --- a/ExampleData/CMakeLists.txt +++ b/ExampleData/CMakeLists.txt @@ -24,21 +24,13 @@ endif(MSVC) # Include cmake tools include(GenerateExportHeader) -# ----------------------------------------------------------------------------- -# Set install directory -# ----------------------------------------------------------------------------- -# 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 # ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED) +find_package(ManiVault COMPONENTS Core PointData CONFIG) + # ----------------------------------------------------------------------------- # Source files # ----------------------------------------------------------------------------- @@ -75,7 +67,7 @@ list(APPEND PLUGIN_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_export.h) # Target include directories # ----------------------------------------------------------------------------- # Include ManiVault headers, including system data plugins -target_include_directories(${PROJECT_NAME} PRIVATE "${MV_INSTALL_DIR}/$/include/") +target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}") # ----------------------------------------------------------------------------- # Target properties @@ -98,18 +90,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::WebEngineWidgets) # Link to ManiVault and data plugins -# 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 MV_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(MV_LINK_PATH "${MV_INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") -set(MV_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) - -set(MV_LINK_LIBRARY "${MV_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}MV_Public${MV_LINK_SUFFIX}") -set(POINTDATA_LINK_LIBRARY "${PLUGIN_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}PointData${MV_LINK_SUFFIX}") - -target_link_libraries(${PROJECT_NAME} PRIVATE "${MV_LINK_LIBRARY}") -target_link_libraries(${PROJECT_NAME} PRIVATE "${POINTDATA_LINK_LIBRARY}") +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::Core) +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::PointData) # ----------------------------------------------------------------------------- # Target installation @@ -129,7 +111,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${MV_INSTALL_DIR}/$ + --prefix ${ManiVault_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -137,6 +119,6 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${MV_INSTALL_DIR}/release/ManiVault\ Studio.exe>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>) endif() diff --git a/ExampleLoader/CMakeLists.txt b/ExampleLoader/CMakeLists.txt index cdda22e..a44578b 100644 --- a/ExampleLoader/CMakeLists.txt +++ b/ExampleLoader/CMakeLists.txt @@ -21,21 +21,13 @@ if(MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif(MSVC) -# ----------------------------------------------------------------------------- -# Set install directory -# ----------------------------------------------------------------------------- -# 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 # ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED) +find_package(ManiVault COMPONENTS Core PointData CONFIG) + # ----------------------------------------------------------------------------- # Source files # ----------------------------------------------------------------------------- @@ -62,7 +54,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES}) # Target include directories # ----------------------------------------------------------------------------- # Include ManiVault headers, including system data plugins -target_include_directories(${PROJECT_NAME} PRIVATE "${MV_INSTALL_DIR}/$/include/") +target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}") # ----------------------------------------------------------------------------- # Target properties @@ -83,18 +75,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::WebEngineWidgets) # Link to ManiVault and data plugins -# 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 MV_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(MV_LINK_PATH "${MV_INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") -set(MV_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) - -set(MV_LINK_LIBRARY "${MV_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}MV_Public${MV_LINK_SUFFIX}") -set(POINTDATA_LINK_LIBRARY "${PLUGIN_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}PointData${MV_LINK_SUFFIX}") - -target_link_libraries(${PROJECT_NAME} PRIVATE "${MV_LINK_LIBRARY}") -target_link_libraries(${PROJECT_NAME} PRIVATE "${POINTDATA_LINK_LIBRARY}") +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::Core) +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::PointData) # ----------------------------------------------------------------------------- # Target installation @@ -109,7 +91,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${MV_INSTALL_DIR}/$ + --prefix ${ManiVault_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -118,6 +100,6 @@ add_custom_command(TARGET ${PROJECT_NAME} 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 ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${MV_INSTALL_DIR}/release/ManiVault\ Studio.exe>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>) endif() diff --git a/ExampleTransformation/CMakeLists.txt b/ExampleTransformation/CMakeLists.txt index 4fd5fd5..1224c35 100644 --- a/ExampleTransformation/CMakeLists.txt +++ b/ExampleTransformation/CMakeLists.txt @@ -21,21 +21,13 @@ if(MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif(MSVC) -# ----------------------------------------------------------------------------- -# Set install directory -# ----------------------------------------------------------------------------- -# 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 # ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED) +find_package(ManiVault COMPONENTS Core PointData CONFIG) + # ----------------------------------------------------------------------------- # Source files # ----------------------------------------------------------------------------- @@ -62,7 +54,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES}) # Target include directories # ----------------------------------------------------------------------------- # Include ManiVault headers, including system data plugins -target_include_directories(${PROJECT_NAME} PRIVATE "${MV_INSTALL_DIR}/$/include/") +target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}") # ----------------------------------------------------------------------------- # Target properties @@ -83,18 +75,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::WebEngineWidgets) # Link to ManiVault and data plugins -# 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 MV_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(MV_LINK_PATH "${MV_INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") -set(MV_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) - -set(MV_LINK_LIBRARY "${MV_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}MV_Public${MV_LINK_SUFFIX}") -set(POINTDATA_LINK_LIBRARY "${PLUGIN_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}PointData${MV_LINK_SUFFIX}") - -target_link_libraries(${PROJECT_NAME} PRIVATE "${MV_LINK_LIBRARY}") -target_link_libraries(${PROJECT_NAME} PRIVATE "${POINTDATA_LINK_LIBRARY}") +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::Core) +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::PointData) # ----------------------------------------------------------------------------- # Target installation @@ -109,7 +91,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${MV_INSTALL_DIR}/$ + --prefix ${ManiVault_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -117,6 +99,6 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - 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/ManiVault\ Studio.exe,${MV_INSTALL_DIR}/release/ManiVault\ Studio.exe>) + set_property(TARGET ${EXAMPLETRANSFORMATION} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) + set_property(TARGET ${EXAMPLETRANSFORMATION} PROPERTY VS_DEBUGGER_COMMAND $,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>) endif() diff --git a/ExampleView/CMakeLists.txt b/ExampleView/CMakeLists.txt index fd41640..f317604 100644 --- a/ExampleView/CMakeLists.txt +++ b/ExampleView/CMakeLists.txt @@ -21,21 +21,13 @@ if(MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif(MSVC) -# ----------------------------------------------------------------------------- -# Set install directory -# ----------------------------------------------------------------------------- -# 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 # ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED) +find_package(ManiVault COMPONENTS Core PointData CONFIG) + # ----------------------------------------------------------------------------- # Source files # ----------------------------------------------------------------------------- @@ -62,7 +54,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES}) # Target include directories # ----------------------------------------------------------------------------- # Include ManiVault headers, including system data plugins -target_include_directories(${PROJECT_NAME} PRIVATE "${MV_INSTALL_DIR}/$/include/") +target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}") # ----------------------------------------------------------------------------- # Target properties @@ -83,18 +75,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::WebEngineWidgets) # Link to ManiVault and data plugins -# 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 MV_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(MV_LINK_PATH "${MV_INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") -set(MV_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) - -set(MV_LINK_LIBRARY "${MV_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}MV_Public${MV_LINK_SUFFIX}") -set(POINTDATA_LINK_LIBRARY "${PLUGIN_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}PointData${MV_LINK_SUFFIX}") - -target_link_libraries(${PROJECT_NAME} PRIVATE "${MV_LINK_LIBRARY}") -target_link_libraries(${PROJECT_NAME} PRIVATE "${POINTDATA_LINK_LIBRARY}") +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::Core) +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::PointData) # ----------------------------------------------------------------------------- # Target installation @@ -109,7 +91,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${MV_INSTALL_DIR}/$ + --prefix ${ManiVault_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -117,6 +99,6 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${MV_INSTALL_DIR}/release/ManiVault\ Studio.exe>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>) endif() diff --git a/ExampleViewJS/CMakeLists.txt b/ExampleViewJS/CMakeLists.txt index 29cfc38..e8cd709 100644 --- a/ExampleViewJS/CMakeLists.txt +++ b/ExampleViewJS/CMakeLists.txt @@ -21,21 +21,13 @@ if(MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif(MSVC) -# ----------------------------------------------------------------------------- -# Set install directory -# ----------------------------------------------------------------------------- -# 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 # ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED) +find_package(ManiVault COMPONENTS Core PointData CONFIG) + # ----------------------------------------------------------------------------- # Source files # ----------------------------------------------------------------------------- @@ -81,7 +73,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${AUX} ${WEB} ${RESOURCE_FI # Target include directories # ----------------------------------------------------------------------------- # Include ManiVault headers, including system data plugins -target_include_directories(${PROJECT_NAME} PRIVATE "${MV_INSTALL_DIR}/$/include/") +target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}") # ----------------------------------------------------------------------------- # Target properties @@ -102,18 +94,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::WebEngineWidgets) # Link to ManiVault and data plugins -# 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 MV_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(MV_LINK_PATH "${MV_INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") -set(MV_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) - -set(MV_LINK_LIBRARY "${MV_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}MV_Public${MV_LINK_SUFFIX}") -set(POINTDATA_LINK_LIBRARY "${PLUGIN_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}PointData${MV_LINK_SUFFIX}") - -target_link_libraries(${PROJECT_NAME} PRIVATE "${MV_LINK_LIBRARY}") -target_link_libraries(${PROJECT_NAME} PRIVATE "${POINTDATA_LINK_LIBRARY}") +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::Core) +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::PointData) # ----------------------------------------------------------------------------- # Target installation @@ -128,7 +110,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${MV_INSTALL_DIR}/$ + --prefix ${ManiVault_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -136,6 +118,6 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${MV_INSTALL_DIR}/release/ManiVault\ Studio.exe>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>) endif() diff --git a/ExampleViewOpenGL/CMakeLists.txt b/ExampleViewOpenGL/CMakeLists.txt index b84cf33..69945a5 100644 --- a/ExampleViewOpenGL/CMakeLists.txt +++ b/ExampleViewOpenGL/CMakeLists.txt @@ -21,21 +21,13 @@ if(MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif(MSVC) -# ----------------------------------------------------------------------------- -# Set install directory -# ----------------------------------------------------------------------------- -# 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 # ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets OpenGL OpenGLWidgets REQUIRED) +find_package(ManiVault COMPONENTS Core PointData CONFIG) + # ----------------------------------------------------------------------------- # Source files # ----------------------------------------------------------------------------- @@ -76,7 +68,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${PLUGIN_WIDGETS} ${PLUGIN_ # Target include directories # ----------------------------------------------------------------------------- # Include ManiVault headers, including system data plugins -target_include_directories(${PROJECT_NAME} PRIVATE "${MV_INSTALL_DIR}/$/include/") +target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}") # ----------------------------------------------------------------------------- # Target properties @@ -99,18 +91,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::OpenGL) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::OpenGLWidgets) # Link to ManiVault and data plugins -# 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 MV_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(MV_LINK_PATH "${MV_INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") -set(MV_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) - -set(MV_LINK_LIBRARY "${MV_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}MV_Public${MV_LINK_SUFFIX}") -set(POINTDATA_LINK_LIBRARY "${PLUGIN_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}PointData${MV_LINK_SUFFIX}") - -target_link_libraries(${PROJECT_NAME} PRIVATE "${MV_LINK_LIBRARY}") -target_link_libraries(${PROJECT_NAME} PRIVATE "${POINTDATA_LINK_LIBRARY}") +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::Core) +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::PointData) # ----------------------------------------------------------------------------- # Target installation @@ -125,7 +107,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${MV_INSTALL_DIR}/$ + --prefix ${ManiVault_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -133,6 +115,6 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${MV_INSTALL_DIR}/release/ManiVault\ Studio.exe>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>) endif() diff --git a/ExampleWriter/CMakeLists.txt b/ExampleWriter/CMakeLists.txt index ec62617..fe3258c 100644 --- a/ExampleWriter/CMakeLists.txt +++ b/ExampleWriter/CMakeLists.txt @@ -21,21 +21,13 @@ if(MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif(MSVC) -# ----------------------------------------------------------------------------- -# Set install directory -# ----------------------------------------------------------------------------- -# 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 # ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED) +find_package(ManiVault COMPONENTS Core PointData CONFIG) + # ----------------------------------------------------------------------------- # Source files # ----------------------------------------------------------------------------- @@ -62,7 +54,7 @@ add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES}) # Target include directories # ----------------------------------------------------------------------------- # Include ManiVault headers, including system data plugins -target_include_directories(${PROJECT_NAME} PRIVATE "${MV_INSTALL_DIR}/$/include/") +target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}") # ----------------------------------------------------------------------------- # Target properties @@ -83,18 +75,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::WebEngineWidgets) # Link to ManiVault and data plugins -# 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 MV_LINK_PATH and PLUGIN_LINK_PATH to your install folder -set(MV_LINK_PATH "${MV_INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") -set(MV_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) - -set(MV_LINK_LIBRARY "${MV_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}MV_Public${MV_LINK_SUFFIX}") -set(POINTDATA_LINK_LIBRARY "${PLUGIN_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}PointData${MV_LINK_SUFFIX}") - -target_link_libraries(${PROJECT_NAME} PRIVATE "${MV_LINK_LIBRARY}") -target_link_libraries(${PROJECT_NAME} PRIVATE "${POINTDATA_LINK_LIBRARY}") +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::Core) +target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::PointData) # ----------------------------------------------------------------------------- # Target installation @@ -109,7 +91,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${MV_INSTALL_DIR}/$ + --prefix ${ManiVault_INSTALL_DIR}/$ ) # ----------------------------------------------------------------------------- @@ -117,6 +99,6 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) - set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${MV_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${MV_INSTALL_DIR}/release/ManiVault\ Studio.exe>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>) endif() diff --git a/conanfile.py b/conanfile.py index 32cbd6e..28b45a2 100644 --- a/conanfile.py +++ b/conanfile.py @@ -104,6 +104,10 @@ def generate(self): # Give the installation directory to CMake tc.variables["MV_INSTALL_DIR"] = self.install_dir + # Find ManiVault with find_package + self.manivault_dir = self.install_dir + '/cmake/mv/' + tc.variables["ManiVault_DIR"] = self.manivault_dir + # Set some build options tc.variables["MV_UNITY_BUILD"] = "ON"