Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable static targets #52

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Enable static targets
  • Loading branch information
IsabelParedes committed Jun 17, 2024
commit 2fea3124a97cdaa405dd23b7328176ab1b40e544
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${XVEGA_CMAKECONFIG_INSTALL_DIR})

if (XVEGA_BUILD_SHARED)
install(EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}Targets.cmake
DESTINATION ${XVEGA_CMAKECONFIG_INSTALL_DIR})
endif ()
install(EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}Targets.cmake
DESTINATION ${XVEGA_CMAKECONFIG_INSTALL_DIR})
12 changes: 10 additions & 2 deletions xvegaConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ find_dependency(xproperty @xproperty_REQUIRED_VERSION@)

if(NOT TARGET @PROJECT_NAME@)
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
get_target_property(@PROJECT_NAME@_INCLUDE_DIR @PROJECT_NAME@ INTERFACE_INCLUDE_DIRECTORIES)

if (TARGET xvega-static)
if (TARGET xvega AND xvega-static)
get_target_property(@PROJECT_NAME@_INCLUDE_DIR xvega INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(@PROJECT_NAME@_LIBRARY xvega LOCATION)
get_target_property(@PROJECT_NAME@_STATIC_LIBRARY xvega-static LOCATION)
elseif (TARGET xvega)
get_target_property(@PROJECT_NAME@_INCLUDE_DIR xvega INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(@PROJECT_NAME@_LIBRARY xvega LOCATION)
elseif (TARGET xvega-static)
get_target_property(@PROJECT_NAME@_INCLUDE_DIR xvega-static INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(@PROJECT_NAME@_STATIC_LIBRARY xvega-static LOCATION)
endif ()

endif()

set(@PROJECT_NAME@_LIBRARY "")