Use STATIC_DEFINE to solve issues with OBJECT library

v0.27.3
Luis Díaz Más 7 years ago
parent 4574a659cc
commit e3f975137c

@ -34,6 +34,7 @@ set( LIBEXIV2_SRC
rafimage.cpp rafimage.cpp
riffvideo.cpp riffvideo.cpp
rw2image.cpp rw2image.cpp
tags.cpp
tgaimage.cpp tgaimage.cpp
tiffimage.cpp tiffimage.cpp
types.cpp types.cpp
@ -137,7 +138,6 @@ set( LIBEXIV2_PRIVATE_HDR
samsungmn_int.hpp samsungmn_int.hpp
sigmamn_int.hpp sigmamn_int.hpp
sonymn_int.hpp sonymn_int.hpp
tags.cpp
tags_int.hpp tags_int.hpp
tiffcomposite_int.hpp tiffcomposite_int.hpp
tifffwd_int.hpp tifffwd_int.hpp
@ -185,6 +185,7 @@ add_library( exiv2lib ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} $<TARGET_OBJECTS:exiv2lib_
generate_export_header(exiv2lib generate_export_header(exiv2lib
EXPORT_MACRO_NAME EXIV2API EXPORT_MACRO_NAME EXIV2API
EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/exiv2lib_export.h EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/exiv2lib_export.h
STATIC_DEFINE exiv2lib_STATIC
) )
if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
@ -201,6 +202,7 @@ set_target_properties( exiv2lib PROPERTIES
set_target_properties( exiv2lib_int PROPERTIES set_target_properties( exiv2lib_int PROPERTIES
POSITION_INDEPENDENT_CODE ON POSITION_INDEPENDENT_CODE ON
COMPILE_DEFINITIONS exiv2lib_STATIC
) )
target_compile_definitions(exiv2lib PRIVATE EXV_LOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" EXV_BUILDING_LIB ) target_compile_definitions(exiv2lib PRIVATE EXV_LOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" EXV_BUILDING_LIB )

@ -10,7 +10,6 @@ add_executable(unit_tests mainTestRunner.cpp
test_TimeValue.cpp test_TimeValue.cpp
test_cr2header_int.cpp test_cr2header_int.cpp
test_helper_functions.cpp test_helper_functions.cpp
$<TARGET_OBJECTS:exiv2lib_int>
) )
#TODO Use GTest::GTest once we upgrade the minimum CMake version required #TODO Use GTest::GTest once we upgrade the minimum CMake version required

Loading…
Cancel
Save