diff --git a/CMakeLists.txt b/CMakeLists.txt index 73920fe..8bee7fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR}) #-------------------------------------- # Find Tinyxml2 if(USE_EXTERNAL_TINYXML2) - gz_find_package(TINYXML2 PRETTY tinyxml2 + gz_find_package(tinyxml2 EXTRA_ARGS CONFIG REQUIRED_BY graphics PRIVATE_FOR graphics) else() @@ -70,13 +70,13 @@ if(NOT MSVC) #------------------------------------ # Find uuid - gz_find_package(UUID REQUIRED PRETTY uuid) + gz_find_package(UUID REQUIRED PRETTY uuid REQUIRED_BY graphics) endif() #------------------------------------ # Find Freeimage -gz_find_package(FreeImage VERSION 3.9 +gz_find_package(freeimage EXTRA_ARGS CONFIG REQUIRED_BY graphics PRIVATE_FOR graphics) @@ -84,6 +84,7 @@ ign_find_package(FreeImage VERSION 3.9 # Find GNU Triangulation Surface Library gz_find_package( GTS PRETTY gts PURPOSE "GNU Triangulation Surface library" + BY_PKGCONFIG gts REQUIRED_BY graphics PRIVATE_FOR graphics) @@ -98,7 +98,7 @@ #------------------------------------ # Find GDAL -gz_find_package(GDAL VERSION 3.0 +gz_find_package(GDAL PKGCONFIG gdal PRIVATE_FOR geospatial REQUIRED_BY geospatial) diff --git a/graphics/src/CMakeLists.txt b/graphics/src/CMakeLists.txt index 000a0ce..f6e1831 100644 --- a/graphics/src/CMakeLists.txt +++ b/graphics/src/CMakeLists.txt @@ -14,8 +14,10 @@ target_link_libraries(${graphics_target} PUBLIC gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER} gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER} PRIVATE ${GzAssimp_LIBRARIES} GTS::GTS - FreeImage::FreeImage) + freeimage::FreeImage) + +target_include_directories(${graphics_target} PRIVATE ${GTS_INCLUDE_DIRS}) @@ -42,14 +44,14 @@ if(USE_EXTERNAL_TINYXML2) # If we are using an external copy of tinyxml2, add its imported target target_link_libraries(${graphics_target} PRIVATE - TINYXML2::TINYXML2) + tinyxml2::tinyxml2) # The collada exporter test uses tinyxml2, so we must link it if we're using # an external copy. The graphics target considers tinyxml2 to be a private # dependency, so it will not automatically get linked to this test. if(TARGET UNIT_ColladaExporter_TEST) - target_link_libraries(UNIT_ColladaExporter_TEST TINYXML2::TINYXML2) + target_link_libraries(UNIT_ColladaExporter_TEST tinyxml2::tinyxml2) endif() else() @@ -79,7 +81,7 @@ # define of tinxml2 major version >= 6 # https://github.com/gazebosim/gz-common/issues/28 -if (NOT TINYXML2_VERSION VERSION_LESS "6.0.0") - message(STATUS "TINYXML2_VERSION ${TINYXML2_VERSION} >= 6.0.0") +if (NOT tinyxml2_VERSION VERSION_LESS "6.0.0") + message(STATUS "TINYXML2_VERSION ${tinyxml2_VERSION} >= 6.0.0") target_compile_definitions(${graphics_target} PRIVATE "TINYXML2_MAJOR_VERSION_GE_6") endif()