Skip to content

Commit

Permalink
conan - change generator to be able to use latest expat version
Browse files Browse the repository at this point in the history
  • Loading branch information
piponazo committed May 16, 2021
1 parent 08c5ed2 commit cc9c644
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
6 changes: 2 additions & 4 deletions cmake/findDependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# set include path for FindXXX.cmake files
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})

find_package (Python3 COMPONENTS Interpreter REQUIRED)

Expand All @@ -8,9 +9,6 @@ if (APPLE)
set(CMAKE_FIND_FRAMEWORK NEVER)
endif()

if (EXISTS ${CMAKE_BINARY_DIR}/conan_paths.cmake)
include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
endif()

find_package(Threads REQUIRED)

Expand Down
7 changes: 2 additions & 5 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Exiv2Conan(ConanFile):
settings = 'os', 'compiler', 'build_type', 'arch'
generators = 'cmake_paths'
generators = 'cmake_find_package'
options = {'unitTests': [True, False],
'xmp': [True, False],
'iconv': [True, False],
Expand Down Expand Up @@ -35,10 +35,7 @@ def requirements(self):
if self.options.xmp:
self.requires('XmpSdk/2016.7@piponazo/stable') # from conan-piponazo
else:
if os_info.is_windows:
self.requires('Expat/2.2.6@pix4d/stable')
else:
self.requires('expat/2.3.0')
self.requires('expat/2.3.0')

def imports(self):
self.copy('*.dll', dst='bin', src='bin')
Expand Down
8 changes: 2 additions & 6 deletions unitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ target_compile_definitions(unit_tests
target_link_libraries(unit_tests
PRIVATE
exiv2lib
GTest::GTest
GTest::Main
GTest::gtest
GTest::gtest_main
)

# ZLIB is used in exiv2lib_int.
Expand All @@ -47,8 +47,4 @@ set_target_properties(unit_tests PROPERTIES
COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS}
)

if (MSVC)
set_target_properties(unit_tests PROPERTIES LINK_FLAGS "/ignore:4099")
endif()

add_test(NAME unit_tests COMMAND unit_tests)
3 changes: 1 addition & 2 deletions xmpsdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ add_library(exiv2-xmp STATIC

target_link_libraries(exiv2-xmp
PRIVATE
$<BUILD_INTERFACE:${EXPAT_LIBRARY}>
EXPAT::EXPAT
)

target_include_directories(exiv2-xmp SYSTEM
PRIVATE
${PROJECT_SOURCE_DIR}/xmpsdk/include
${EXPAT_INCLUDE_DIR}
)

# Prevent a denial-service-attack related to XML entity expansion
Expand Down

0 comments on commit cc9c644

Please sign in to comment.