--- darktable-0.9.3.orig/src/CMakeLists.txt +++ darktable-0.9.3/src/CMakeLists.txt @@ -290,21 +290,19 @@ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../tools/create_metadata.sh ${CMAKE_CURRENT_SOURCE_DIR}/../tools/metadata.txt ${CMAKE_CURRENT_BINARY_DIR} ) - -# this is a dummy library whose sole purpose is to serve as a dependency for subdirs, such as imageio/storage/gallery. -# cmake can't depend on custom targets in other directories than the current one. -add_library(metadata_dummy ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h) +add_custom_target(metadata_gen DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h) # # build libdarktable # -add_library(lib_darktable STATIC SHARED ${CMAKE_CURRENT_BINARY_DIR}/preferences_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c ${SOURCES}) +add_library(lib_darktable SHARED ${CMAKE_CURRENT_BINARY_DIR}/preferences_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c ${SOURCES}) +add_dependencies(lib_darktable metadata_gen) if(APPLE) set_target_properties(lib_darktable PROPERTIES INSTALL_NAME_DIR "@executable_path/../lib/darktable") endif(APPLE) set_target_properties(lib_darktable PROPERTIES OUTPUT_NAME darktable) set_target_properties(lib_darktable PROPERTIES LINKER_LANGUAGE C) - +target_link_libraries(lib_darktable ${LIBS}) # # the libraw part is a bit of a hack: @@ -329,7 +327,7 @@ add_dependencies(lib_darktable rawspeed) add_library(rawspeed_static STATIC IMPORTED) set_target_properties(rawspeed_static PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/external/rawspeed/librawspeed.a) - target_link_libraries(lib_darktable ${LIBS} rawspeed_static) + target_link_libraries(lib_darktable rawspeed_static) # compile rawspeed add_subdirectory(external/rawspeed) endif(NOT DONT_USE_RAWSPEED) --- darktable-0.9.3.orig/src/imageio/storage/CMakeLists.txt +++ darktable-0.9.3/src/imageio/storage/CMakeLists.txt @@ -10,7 +10,7 @@ foreach(module ${MODULES} ${MODULES_EXPERIMENTAL}) add_library(${module} MODULE "${module}.c") endforeach(module) -add_dependencies(gallery metadata_dummy) +add_dependencies(gallery metadata_gen) foreach(module ${MODULES}) target_link_libraries(${module} ${LIBS})