Use target_sources to extend the list of sources in exceptional situations

v0.27.3
Luis Diaz Mas 8 years ago committed by Luis Diaz Mas
parent 45807ca03d
commit f5f5826c03

@ -61,6 +61,10 @@ add_executable ( pathtest path-test.cpp ../src/utils.cpp)
set_target_properties( pathtest PROPERTIES OUTPUT_NAME path-test ) set_target_properties( pathtest PROPERTIES OUTPUT_NAME path-test )
target_link_libraries( pathtest PRIVATE exiv2lib) target_link_libraries( pathtest PRIVATE exiv2lib)
if(NOT EXV_HAVE_TIMEGM )
target_sources(pathtest PRIVATE ../src/localtime.c)
endif()
add_executable( exiv2json exiv2json.cpp Jzon.cpp) add_executable( exiv2json exiv2json.cpp Jzon.cpp)
target_link_libraries( exiv2json PRIVATE exiv2lib) target_link_libraries( exiv2json PRIVATE exiv2lib)

@ -275,32 +275,26 @@ msvc_runtime_configure(${EXIV2_ENABLE_SHARED} ${EXIV2_ENABLE_DYNAMIC_RUNTIME})
# ****************************************************************************** # ******************************************************************************
# exiv2 application # exiv2 application
## set( EXIV2_SRC exiv2.cpp
# Create source file lists for applications exiv2app.hpp
# exiv2 application
SET( EXIV2_SRC exiv2.cpp
actions.cpp actions.cpp
utils.cpp
)
SET( EXIV2_HDR exiv2app.hpp
actions.hpp actions.hpp
utils.cpp
utils.hpp utils.hpp
) )
##
# modify source lists to suit environment # modify source lists to suit environment
IF(NOT EXV_HAVE_TIMEGM ) if(NOT EXV_HAVE_TIMEGM )
SET( LIBEXIV2_SRC ${LIBEXIV2_SRC} localtime.c ) target_sources(exiv2lib PRIVATE localtime.c)
SET( EXIV2_SRC ${EXIV2_SRC} localtime.c ) target_sources(exiv2 PRIVATE localtime.c)
SET( PATHTEST_SRC ${PATHTEST_SRC} localtime.c ) endif()
ENDIF()
IF( MSVC ) if (MSVC)
SET( EXIV2_SRC ${EXIV2_SRC} getopt_win32.c ) target_sources(exiv2lib PRIVATE getopt_win32.c)
SET( LIBEXIV2_SRC ${LIBEXIV2_SRC} getopt_win32.c ) target_sources(exiv2 PRIVATE getopt_win32.c)
ENDIF( MSVC ) endif()
add_executable( exiv2 ${EXIV2_SRC} ${EXIV2_HDR} ) add_executable( exiv2 ${EXIV2_SRC} )
target_link_libraries( exiv2 PRIVATE exiv2lib ) target_link_libraries( exiv2 PRIVATE exiv2lib )
install(TARGETS exiv2 RUNTIME DESTINATION bin) install(TARGETS exiv2 RUNTIME DESTINATION bin)

Loading…
Cancel
Save