diff --git a/include/exiv2/config.h b/include/exiv2/config.h index 45e45450..eb3a8d3a 100644 --- a/include/exiv2/config.h +++ b/include/exiv2/config.h @@ -31,14 +31,9 @@ #define HAVE_NTOHLL 1 #endif -/* Disable warning 4251 from std templates about exporting interfaces */ -#ifdef EXV_HAVE_DLL -#pragma warning( disable : 4251 ) -#endif - -/* Disable warnings about 'deprecated' standard functions */ #if _MSC_VER >= _MSC_VER_2005 -# pragma warning(disable : 4996) +#pragma warning(disable : 4996) // Disable warnings about 'deprecated' standard functions +#pragma warning(disable : 4251) // Disable warnings from std templates about exporting interfaces #endif /* On Microsoft compilers pid_t has to be set to int. */ diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index c35e9b08..e42c4416 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -94,12 +94,8 @@ add_executable(remotetest remotetest.cpp) list(APPEND APPLICATIONS remotetest) # ****************************************************************************** -# set compiler -DEXV_HAVE_DLL when linking exiv2 dll foreach(application ${APPLICATIONS}) target_link_libraries(${application} PRIVATE exiv2lib) - if ( BUILD_SHARED_LIBS ) - target_compile_definitions(${application} PRIVATE EXV_HAVE_DLL ) - endif() if( EXIV2_ENABLE_PNG ) target_link_libraries( ${application} PRIVATE ${ZLIB_LIBRARIES} ) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 18af5d9d..879b194a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -215,15 +215,10 @@ set_target_properties( exiv2lib_int PROPERTIES COMPILE_DEFINITIONS exiv2lib_STATIC ) -target_compile_definitions(exiv2lib PRIVATE EXV_LOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" EXV_BUILDING_LIB ) - -if ( BUILD_SHARED_LIBS ) - target_compile_definitions(exiv2lib PRIVATE EXV_HAVE_DLL ) -endif() - -if ( ${BUILD_SHARED_LIBS} ) - target_compile_definitions(exiv2lib PUBLIC EXV_HAVE_DLL) -endif() +target_compile_definitions(exiv2lib + PUBLIC + EXV_LOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}" +) if ( UNIX AND CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" ) set (FREEBSD 1) @@ -338,11 +333,7 @@ if(EXIV2_BUILD_EXIV2_COMMAND) XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES" ) - target_compile_definitions(exiv2 PRIVATE EXV_LOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" ) target_link_libraries( exiv2 PRIVATE exiv2lib ) - if ( BUILD_SHARED_LIBS ) - target_compile_definitions(exiv2 PRIVATE EXV_HAVE_DLL ) - endif() # modify source lists to suit environment target_include_directories(exiv2 PRIVATE ${CMAKE_SOURCE_DIR}/include/) diff --git a/src/version.cpp b/src/version.cpp index eb308518..44b6f06e 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -170,7 +170,7 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys) int debug=0; #endif -#if defined(DLL_EXPORT) || defined(EXV_HAVE_DLL) +#if defined(DLL_EXPORT) int dll=1; #else int dll=0;