Project

General

Profile

Feature #1041 » CMake-nmake-toolchain.patch

Daniel Kaneider, 15 Mar 2015 16:44

View differences:

samples/CMakeLists.txt (working copy)
52 52
    ADD_EXECUTABLE( ${target} ${target}.cpp )
53 53
    ADD_TEST( ${target}_test ${target} )
54 54
    TARGET_LINK_LIBRARIES( ${target} exiv2lib )
55
    INSTALL( TARGETS ${target} ${INSTALL_TARGET_STANDARD_ARGS} )
55 56
ENDFOREACH(entry ${SAMPLES})
56 57

  
57 58
###################################
58 59
# metacopy/path-test sample applications require utils.cpp support
59
SET( MC_SRC metacopy.cpp ../src/utils.cpp )
60
IF( MSVC )
61
    SET( PATHTEST_SRC      ${PATHTEST_SRC} ../src/getopt_win32.c )
62
    SET( MC_SRC            ${MC_SRC}       ../src/getopt_win32.c )
63
ENDIF( MSVC )
64

  
65
SET( MC_SRC ${MC_SRC} metacopy.cpp ../src/utils.cpp )
60 66
ADD_EXECUTABLE( metacopy ${MC_SRC} )
61 67
TARGET_LINK_LIBRARIES( metacopy exiv2lib )
62 68
INSTALL( TARGETS metacopy ${INSTALL_TARGET_STANDARD_ARGS} )
63 69

  
64
SET( PATHTEST_SRC path-test.cpp ../src/utils.cpp )
70
SET( PATHTEST_SRC ${PATHTEST_SRC}  path-test.cpp ../src/utils.cpp )
65 71
ADD_EXECUTABLE( pathtest ${PATHTEST_SRC} )
66 72
SET_TARGET_PROPERTIES( pathtest PROPERTIES OUTPUT_NAME path-test )
67 73
TARGET_LINK_LIBRARIES( pathtest exiv2lib )
src/CMakeLists.txt (working copy)
217 217
ENDIF( NOT HAVE_TIMEGM )
218 218

  
219 219
IF( MSVC )
220
    SET( MC_SRC           ${MC_SRC}       getopt_win32.c )
221 220
    SET( EXIV2_SRC        ${EXIV2_SRC}    getopt_win32.c )
222 221
    SET( LIBEXIV2_SRC     ${LIBEXIV2_SRC} getopt_win32.c )
223
    SET( PATHTEST_SRC     ${PATHTEST_SRC} getopt_win32.c )
224 222
ENDIF( MSVC )
225 223

  
226 224
##
......
294 292
ENDIF(CYGWIN OR MINGW)
295 293

  
296 294

  
297
##
298
# copy curl dlls to output directory (TODO: rewrite for NMake)
299
IF ( MSVC AND EXIV2_ENABLE_CURL )
300
    get_filename_component(CURL_LIBRARY_DIR ${CURL_LIBRARY} PATH)
301
    string(REGEX REPLACE "/" "\\\\" CURL_LIBRARY_DIR ${CURL_LIBRARY_DIR})
302
    ADD_CUSTOM_COMMAND(
303
      TARGET exiv2lib
304
      POST_BUILD
305
      COMMAND copy /y ${CURL_LIBRARY_DIR}\\*.dll $(SolutionDir)\\bin\\${P_DIR}\\${T_DIR}\\$(ConfigurationName)
306
    )
307
ENDIF()
308
INSTALL( TARGETS exiv2lib ${INSTALL_TARGET_STANDARD_ARGS} )
309

  
310
##
311
# copy libssh dlls to output directory (TODO: rewrite for NMake)
312
IF ( MSVC AND EXIV2_ENABLE_SSH )
313
    get_filename_component(SSH_LIBRARY_DIR ${SSH_LIBRARY} PATH)
314
    string(REGEX REPLACE "/" "\\\\" SSH_LIBRARY_DIR ${SSH_LIBRARY_DIR})
315
    ADD_CUSTOM_COMMAND(
316
      TARGET exiv2lib
317
      POST_BUILD
318
      COMMAND copy /y ${SSH_LIBRARY_DIR}\\*.dll $(SolutionDir)\\bin\\${P_DIR}\\${T_DIR}\\$(ConfigurationName)
319
    )
320
ENDIF()
321
INSTALL( TARGETS exiv2lib ${INSTALL_TARGET_STANDARD_ARGS} )
322

  
323
##
324
# copy zlib and expat dlls to output directory (TODO: rewrite for NMake)
325
IF ( MSVC AND EXIV2_ENABLE_SHARED )
326
    get_filename_component(EXPAT_LIBRARY_DIR ${EXPAT_LIBRARY} PATH)
327
    string(REGEX REPLACE "/" "\\\\" EXPAT_LIBRARY_DIR ${EXPAT_LIBRARY_DIR})
328
    get_filename_component(ZLIB_LIBRARY_DIR ${ZLIB_LIBRARY} PATH)
329
    string(REGEX REPLACE "/" "\\\\" ZLIB_LIBRARY_DIR ${ZLIB_LIBRARY_DIR})
330
    ADD_CUSTOM_COMMAND(
331
      TARGET exiv2lib
332
      POST_BUILD
333
      COMMAND copy /y ${EXPAT_LIBRARY_DIR}\\*.dll $(SolutionDir)\\bin\\${P_DIR}\\${T_DIR}\\$(ConfigurationName)
334
    )
335
    ADD_CUSTOM_COMMAND(
336
      TARGET exiv2lib
337
      POST_BUILD
338
      COMMAND copy /y ${ZLIB_LIBRARY_DIR}\\*.dll $(SolutionDir)\\bin\\${P_DIR}\\${T_DIR}\\$(ConfigurationName)
339
    )
340
ENDIF()
341 295
INSTALL( TARGETS exiv2lib ${INSTALL_TARGET_STANDARD_ARGS} )
342 296

  
343 297
# ******************************************************************************
(1-1/4)