diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 4c724434..5cfe20f6 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -71,8 +71,8 @@ target_link_libraries( exiv2json PRIVATE exiv2lib) install( TARGETS metacopy pathtest exiv2json RUNTIME DESTINATION bin) if (MSVC) - target_sources(pathtest PRIVATE ../getopt_win32.c) - target_sources(metacopy PRIVATE ../getopt_win32.c) + target_sources(pathtest PRIVATE ../src/getopt_win32.c) + target_sources(metacopy PRIVATE ../src/getopt_win32.c) endif() if( EXIV2_ENABLE_LIBXMP ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 82a41893..d41c6725 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -282,6 +282,13 @@ set( EXIV2_SRC exiv2.cpp utils.hpp ) +add_executable( exiv2 ${EXIV2_SRC} ) +target_link_libraries( exiv2 PRIVATE exiv2lib ) +install(TARGETS exiv2 RUNTIME DESTINATION bin) + +# TODO This should not be needed here! we need to fix the previous TODO +target_include_directories(exiv2 PRIVATE ${CMAKE_SOURCE_DIR}/include/) + # modify source lists to suit environment if(NOT EXV_HAVE_TIMEGM ) target_sources(exiv2lib PRIVATE localtime.c) @@ -293,13 +300,6 @@ if (MSVC) target_sources(exiv2 PRIVATE getopt_win32.c) endif() -add_executable( exiv2 ${EXIV2_SRC} ) -target_link_libraries( exiv2 PRIVATE exiv2lib ) -install(TARGETS exiv2 RUNTIME DESTINATION bin) - -# TODO This should not be needed here! we need to fix the previous TODO -target_include_directories(exiv2 PRIVATE ${CMAKE_SOURCE_DIR}/include/) - # ****************************************************************************** # Man page INSTALL( FILES exiv2.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )