Skip to content

Commit

Permalink
fix cmake setup
Browse files Browse the repository at this point in the history
- export dependencies which are added via EP
  • Loading branch information
modass committed Jun 17, 2021
1 parent 7a1621b commit cca01bc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 38 deletions.
2 changes: 2 additions & 0 deletions cmake/hyproConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ get_filename_component(@TARGET@_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(CMakeFindDependencyMacro)
find_dependency(carl)

@DEPENDENT_TARGETS@

# Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET @TARGET@ AND NOT @TARGET@_BINARY_DIR)
include("${@TARGET@_CMAKE_DIR}/hyproTargets.cmake")
Expand Down
26 changes: 13 additions & 13 deletions src/resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ if(carl_FOUND)
#add_library(carl_SHARED ALIAS carl-shared)

include(carlVersionMacros)
export_target(DEPENDENT_TARGETS EIGEN3)
if(CARL_LOGGING_POST_1910)
export_target(DEPENDENT_TARGETS carl-logging-shared)
export_target(DEPENDENT_TARGETS carl-logging-static)
endif()
#export_target(DEPENDENT_TARGETS EIGEN3)
#if(CARL_LOGGING_POST_1910)
# export_target(DEPENDENT_TARGETS carl-logging-shared)
# export_target(DEPENDENT_TARGETS carl-logging-static)
#endif()

get_target_property(carl_libs_shared carl-shared INTERFACE_LINK_LIBRARIES)
# filter only non-system libs (post-fixed with "SHARED")
Expand All @@ -44,38 +44,38 @@ if(carl_FOUND)
# filter only non-system libs (post-fixed with "STATIC")
list(FILTER carl_libs_static INCLUDE REGEX ".*_STATIC")

export_target(DEPENDENT_TARGETS carl-shared)
export_target(DEPENDENT_TARGETS carl-static)
#export_target(DEPENDENT_TARGETS carl-shared)
#export_target(DEPENDENT_TARGETS carl-static)

set(DEPENDENT_TARGETS ${DEPENDENT_TARGETS} PARENT_SCOPE)
build_target_include_dirs_from(${PROJECT_NAME}-objects SYSTEM PUBLIC carl-shared)
#build_target_include_dirs_from(${PROJECT_NAME}-objects SYSTEM PUBLIC ${carl_libs_shared})
target_link_libraries(${PROJECT_NAME}-static PUBLIC carl-static)
build_target_include_dirs_from(${PROJECT_NAME}-static SYSTEM INTERFACE carl-static)
foreach(item ${carl_libs_static})
#foreach(item ${carl_libs_static})
#target_link_libraries(${PROJECT_NAME}-static PUBLIC ${item})
export_target(DEPENDENT_TARGETS ${item})
# export_target(DEPENDENT_TARGETS ${item})
#if(NOT TARGET ${item})
# get_target_property(include ${item} INTERFACE_INCLUDE_DIRECTORY)
# get_target_property(lib ${item} IMPORTED_LOCATION)
# add_library(${item} STATIC IMPORTED GLOBAL)
# set_target_properties(${item} PROPERTIES IMPORTED_LOCATION "${lib}")
# set_target_properties(${item} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include}")
#endif()
endforeach()
#endforeach()
target_link_libraries(${PROJECT_NAME}-shared PUBLIC carl-shared)
build_target_include_dirs_from(${PROJECT_NAME}-shared SYSTEM INTERFACE carl-shared)
foreach(item ${carl_libs_shared})
#foreach(item ${carl_libs_shared})
#target_link_libraries(${PROJECT_NAME}-shared PUBLIC ${item})
export_target(DEPENDENT_TARGETS ${item})
# export_target(DEPENDENT_TARGETS ${item})
#if(NOT TARGET ${item})
# get_target_property(include ${item} INTERFACE_INCLUDE_DIRECTORY)
# get_target_property(lib ${item} IMPORTED_LOCATION)
# add_library(${item} SHARED IMPORTED GLOBAL)
# set_target_properties(${item} PROPERTIES IMPORTED_LOCATION "${lib}")
# set_target_properties(${item} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include}")
#endif()
endforeach()
#endforeach()
else()
message("-- Download version of CArL")
include(carl.cmake)
Expand Down
50 changes: 25 additions & 25 deletions src/resources/carl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,31 @@ target_link_libraries(${PROJECT_NAME}-shared PUBLIC EIGEN3)

include(carlVersionMacros)

export_target(DEPENDENT_TARGETS GMPXX_SHARED)
export_target(DEPENDENT_TARGETS GMPXX_STATIC GMP_STATIC)
export_target(DEPENDENT_TARGETS EIGEN3)
if(CARL_LOGGING_POST_1910)
export_target(DEPENDENT_TARGETS carl-logging-shared)
export_target(DEPENDENT_TARGETS carl-logging-static)
endif()

export_target(DEPENDENT_TARGETS carl_SHARED)
export_target(DEPENDENT_TARGETS carl_STATIC)

get_target_property(libs carl_SHARED INTERFACE_LINK_LIBRARIES)
# filter only non-system libs (post-fixed with "SHARED")
list(FILTER libs INCLUDE REGEX ".*_SHARED")
foreach(item ${libs})
export_target(DEPENDENT_TARGETS ${item})
endforeach()
get_target_property(libs carl_STATIC INTERFACE_LINK_LIBRARIES)
# filter only non-system libs (post-fixed with "STATIC")
list(FILTER libs INCLUDE REGEX ".*_STATIC")
foreach(item ${libs})
export_target(DEPENDENT_TARGETS ${item})
endforeach()

set(DEPENDENT_TARGETS ${DEPENDENT_TARGETS} PARENT_SCOPE)
#export_target(DEPENDENT_TARGETS GMPXX_SHARED)
#export_target(DEPENDENT_TARGETS GMPXX_STATIC GMP_STATIC)
#export_target(DEPENDENT_TARGETS EIGEN3)
#if(CARL_LOGGING_POST_1910)
# export_target(DEPENDENT_TARGETS carl-logging-shared)
# export_target(DEPENDENT_TARGETS carl-logging-static)
#endif()

#export_target(DEPENDENT_TARGETS carl_SHARED)
#export_target(DEPENDENT_TARGETS carl_STATIC)

#get_target_property(libs carl_SHARED INTERFACE_LINK_LIBRARIES)
## filter only non-system libs (post-fixed with "SHARED")
#list(FILTER libs INCLUDE REGEX ".*_SHARED")
#foreach(item ${libs})
# export_target(DEPENDENT_TARGETS ${item})
#endforeach()
#get_target_property(libs carl_STATIC INTERFACE_LINK_LIBRARIES)
## filter only non-system libs (post-fixed with "STATIC")
#list(FILTER libs INCLUDE REGEX ".*_STATIC")
#foreach(item ${libs})
# export_target(DEPENDENT_TARGETS ${item})
#endforeach()
#
#set(DEPENDENT_TARGETS ${DEPENDENT_TARGETS} PARENT_SCOPE)


add_dependencies(hypro_resources CArL-EP)

0 comments on commit cca01bc

Please sign in to comment.