Permalink
Browse files

High-Level API: Add missing CMake dependencies

  • Loading branch information...
sanssecours committed Dec 24, 2018
1 parent 9a4e739 commit 2fdd87b038fd5f9937a083bb62776bf968bb841f
@@ -6,7 +6,7 @@ macro (do_benchmark source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${ADDITIONAL_SOURCES} benchmarks.c benchmarks.h ${source}.c)
add_executable (benchmark_${source} ${SOURCES})
add_dependencies (benchmark_${source} kdberrors_generated)
add_dependencies (benchmark_${source} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (benchmark_${source} elektra-kdb elektra-meta)

@@ -12,7 +12,7 @@ function (add_lib name)

if (BUILD_SHARED)
add_library (elektra-${name} SHARED ${ARG_SOURCES})
add_dependencies (elektra-${name} kdberrors_generated)
add_dependencies (elektra-${name} kdberrors_generated elektra_error_codes_generated)

target_link_libraries (elektra-${name} elektra-core ${ARG_LINK_ELEKTRA})
endif (BUILD_SHARED)
@@ -121,7 +121,7 @@ function (add_plugintest testname)

set (testexename testmod_${testname})
add_executable (${testexename} ${TEST_SOURCES})
add_dependencies (${testexename} kdberrors_generated)
add_dependencies (${testexename} kdberrors_generated elektra_error_codes_generated)

if (BUILD_SHARED)
if (ARG_LINK_PLUGIN)
@@ -555,7 +555,7 @@ function (add_plugin PLUGIN_SHORT_NAME)
endif (ARG_CPP)

add_library (${PLUGIN_OBJS} OBJECT ${ARG_SOURCES})
add_dependencies (${PLUGIN_OBJS} kdberrors_generated)
add_dependencies (${PLUGIN_OBJS} kdberrors_generated elektra_error_codes_generated)
if (ARG_DEPENDS)
add_dependencies (${PLUGIN_OBJS} ${ARG_DEPENDS})
endif ()
@@ -603,7 +603,7 @@ function (add_plugin PLUGIN_SHORT_NAME)

if (BUILD_SHARED)
add_library (${PLUGIN_NAME} MODULE ${ARG_SOURCES} ${ARG_OBJECT_SOURCES})
add_dependencies (${PLUGIN_NAME} kdberrors_generated)
add_dependencies (${PLUGIN_NAME} kdberrors_generated elektra_error_codes_generated)
if (ARG_DEPENDS)
add_dependencies (${PLUGIN_NAME} ${ARG_DEPENDS})
endif ()
@@ -26,7 +26,7 @@ macro (add_gtest source)
if (BUILD_TESTING)
set (SOURCES ${HDR_FILES} ${source}.cpp ${ARG_SOURCES})
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)

if (ARG_LINK_TOOLS)
target_link_elektratools (${source} ${ARG_LINK_ELEKTRA})
@@ -8,7 +8,7 @@ macro (do_example source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${source}.c)
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (${source} elektra-kdb)

@@ -50,7 +50,7 @@ if (FOUND_NAME GREATER -1)
set (SOURCES ${SRC_FILES} ${HDR_FILES})

add_executable (${EXAMPLE} ${SOURCES})
add_dependencies (${EXAMPLE} kdberrors_generated)
add_dependencies (${EXAMPLE} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (${EXAMPLE} elektra-kdb elektra-notification)

@@ -69,7 +69,7 @@ if (FOUND_NAME GREATER -1)
endif ()

add_executable (${EXAMPLE} ${SOURCES})
add_dependencies (${EXAMPLE} kdberrors_generated)
add_dependencies (${EXAMPLE} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (${EXAMPLE} elektra-kdb elektra-notification elektra-io elektra-io-uv)
if (BUILD_FULL OR BUILD_STATIC)
@@ -109,7 +109,7 @@ if (FOUND_NAME GREATER -1)
endif ()

add_executable (${EXAMPLE} ${SOURCES})
add_dependencies (${EXAMPLE} kdberrors_generated)
add_dependencies (${EXAMPLE} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (${EXAMPLE} elektra-kdb elektra-notification elektra-io elektra-io-glib)
if (BUILD_FULL OR BUILD_STATIC)
@@ -7,7 +7,7 @@ macro (do_benchmark source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${source}.cpp)
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (${source} elektra-kdb elektra-meta)

@@ -7,7 +7,7 @@ macro (do_example source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${source}.cpp)
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (${source} elektra-kdb)

@@ -35,7 +35,7 @@ add_headers (ELEKTRA_HEADERS)
set (SOURCES ${GELEKTRA_SRC_FILES} ${GELEKTRA_HDR_FILES} ${ELEKTRA_HEADERS})

add_library (${GELEKTRA_LIBRARY} SHARED ${SOURCES})
add_dependencies (${GELEKTRA_LIBRARY} kdberrors_generated)
add_dependencies (${GELEKTRA_LIBRARY} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${GELEKTRA_LIBRARY} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (${GELEKTRA_LIBRARY} SYSTEM PUBLIC ${GOBJECT_INCLUDE_DIRS})
@@ -9,7 +9,7 @@ macro (do_benchmark source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${source}.cpp)
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)

target_link_elektra (${source})

@@ -8,7 +8,7 @@ macro (do_example source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${source}.c)
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)
install (TARGETS ${source} DESTINATION ${TARGET_TOOL_EXEC_FOLDER})

set_target_properties (${source}
@@ -9,7 +9,7 @@ file (GLOB_RECURSE SRC_FILES
set (SOURCES ${SRC_FILES} ${HDR_FILES})

add_library (elektraintercept-env SHARED ${SOURCES})
add_dependencies (elektraintercept-env kdberrors_generated)
add_dependencies (elektraintercept-env kdberrors_generated elektra_error_codes_generated)

target_link_libraries (elektraintercept-env ${CMAKE_DL_LIBS})
target_link_libraries (elektraintercept-env elektra-kdb elektra-meta) # must be shared!
@@ -47,7 +47,7 @@ list (APPEND TEST_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/testio_${BINDING_VARIANT}.c")

add_executable (${testexename} ${TEST_SOURCES})
add_dependencies (${testexename} kdberrors_generated)
add_dependencies (${testexename} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${testexename} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")

@@ -52,7 +52,7 @@ else () # Build library
endif ()

add_executable (${testexename} ${TEST_SOURCES})
add_dependencies (${testexename} kdberrors_generated)
add_dependencies (${testexename} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${testexename} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")
target_include_directories (${testexename}
@@ -17,7 +17,7 @@ endif ()
set (example exampleio_ev)

add_executable (${example} ${SOURCES})
add_dependencies (${example} kdberrors_generated)
add_dependencies (${example} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${example} SYSTEM PUBLIC ${LIBEV_INCLUDE_DIRS})

@@ -58,7 +58,7 @@ else ()
endif ()

add_executable (${testexename} ${TEST_SOURCES})
add_dependencies (${testexename} kdberrors_generated)
add_dependencies (${testexename} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${testexename} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")
target_include_directories (${testexename}
@@ -17,7 +17,7 @@ endif ()
set (example exampleio_glib)

add_executable (${example} ${SOURCES})
add_dependencies (${example} kdberrors_generated)
add_dependencies (${example} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${example} SYSTEM PUBLIC ${GLIB_INCLUDE_DIRS})

@@ -73,7 +73,7 @@ else ()
endif ()

add_executable (${TESTEXENAME} ${TEST_SOURCES})
add_dependencies (${TESTEXENAME} kdberrors_generated)
add_dependencies (${TESTEXENAME} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${TESTEXENAME} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")

@@ -17,7 +17,7 @@ endif ()
set (EXAMPLE exampleio_uv)

add_executable (${EXAMPLE} ${SOURCES})
add_dependencies (${EXAMPLE} kdberrors_generated)
add_dependencies (${EXAMPLE} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${EXAMPLE} SYSTEM PUBLIC ${LIBUV_INCLUDE_DIRS})

@@ -106,8 +106,7 @@ if (BUILD_SHARED)

get_property (elektra-shared_SRCS GLOBAL PROPERTY elektra-shared_SRCS)
add_library (elektra-core SHARED ${CORE_FILES} ${elektra-shared_SRCS})
add_dependencies (elektra-core kdberrors_generated)
add_dependencies (elektra-core elektra_error_codes_generated)
add_dependencies (elektra-core kdberrors_generated elektra_error_codes_generated)

get_property (elektra-shared_LIBRARIES GLOBAL PROPERTY elektra-shared_LIBRARIES)
target_link_libraries (elektra-core ${elektra-shared_LIBRARIES})
@@ -116,15 +115,15 @@ if (BUILD_SHARED)
include_directories (${elektra-shared_INCLUDES})

add_library (elektra-kdb SHARED ${KDB_FILES})
add_dependencies (elektra-kdb kdberrors_generated)
add_dependencies (elektra-kdb kdberrors_generated elektra_error_codes_generated)
target_link_libraries (elektra-kdb elektra-core)

# ~~~
# message(STATUS "ignore the following ADD_LIBRARY warning")
# add_library (elektra INTERFACE) # no SOVERSION?
# ~~~
add_library (elektra SHARED ${KDB_FILES} ${CORE_FILES} ${elektra-shared_SRCS})
add_dependencies (elektra kdberrors_generated)
add_dependencies (elektra kdberrors_generated elektra_error_codes_generated)
get_property (elektra-extension_LIBRARIES GLOBAL PROPERTY elektra-extension_LIBRARIES)
target_link_libraries (elektra ${elektra-shared_LIBRARIES})

@@ -197,8 +196,7 @@ endif (BUILD_FULL OR BUILD_STATIC)
if (BUILD_FULL)
set_source_files_properties (${PROJECT_BINARY_DIR}/src/error/elektra_errors.c PROPERTIES GENERATED ON)
add_library (elektra-full SHARED ${SOURCES})
add_dependencies (elektra-full kdberrors_generated)
add_dependencies (elektra-full elektra_error_codes_generated)
add_dependencies (elektra-full kdberrors_generated elektra_error_codes_generated)

target_link_libraries (elektra-full ${elektra-full_LIBRARIES})

@@ -226,9 +224,9 @@ if (BUILD_FULL)
endif (BUILD_FULL)

if (BUILD_STATIC)
set_source_files_properties (${PROJECT_BINARY_DIR}/src/error/elektra_errors.c PROPERTIES GENERATED ON)
add_library (elektra-static STATIC ${SOURCES})
add_dependencies (elektra-static kdberrors_generated)
add_dependencies (elektra-static elektra_error_codes_generated)
add_dependencies (elektra-static kdberrors_generated elektra_error_codes_generated)

target_link_libraries (elektra-static ${elektra-full_LIBRARIES})

@@ -19,7 +19,7 @@ if (BUILD_TESTING
${HDR_FILES})

add_executable (${name} ${TEST_SOURCES})
add_dependencies (${name} kdberrors_generated)
add_dependencies (${name} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${name} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")

@@ -16,7 +16,7 @@ if (BUILD_TESTING)
${HDR_FILES})

add_executable (${name} ${TEST_SOURCES})
add_dependencies (${name} kdberrors_generated)
add_dependencies (${name} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${name} PUBLIC "${CMAKE_SOURCE_DIR}/tests/cframework")

@@ -8,7 +8,7 @@ macro (do_benchmark source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${source}.cpp)
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)

target_link_elektratools (${source} elektra-kdb)

@@ -8,7 +8,7 @@ macro (do_example source)
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}")
set (SOURCES ${HDR_FILES} ${source}.cpp)
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)

target_link_elektratools (${source})

@@ -23,7 +23,7 @@ set (__symbols_file ${CMAKE_CURRENT_SOURCE_DIR}/libelektratools-symbols.map)

if (BUILD_SHARED)
add_library (elektratools SHARED ${SOURCES})
add_dependencies (elektratools kdberrors_generated)
add_dependencies (elektratools kdberrors_generated elektra_error_codes_generated)

target_link_libraries (elektratools elektra-core elektra-kdb elektra-plugin elektra-ease elektra-meta)

@@ -50,7 +50,7 @@ endif (BUILD_SHARED)

if (BUILD_FULL)
add_library (elektratools-full SHARED ${SOURCES})
add_dependencies (elektratools-full kdberrors_generated)
add_dependencies (elektratools-full kdberrors_generated elektra_error_codes_generated)

target_link_libraries (elektratools-full elektra-full)

@@ -77,7 +77,7 @@ endif (BUILD_FULL)

if (BUILD_STATIC)
add_library (elektratools-static STATIC ${SOURCES})
add_dependencies (elektratools-static kdberrors_generated)
add_dependencies (elektratools-static kdberrors_generated elektra_error_codes_generated)

target_link_libraries (elektratools-static elektra-static)

@@ -32,7 +32,7 @@ if (ADDTESTING_PHASE)
set (SOURCES ${SRC_FILES} ${HDR_FILES} ${ELEKTRA_HEADERS})

add_executable (${example} ${SOURCES})
add_dependencies (${example} kdberrors_generated)
add_dependencies (${example} kdberrors_generated elektra_error_codes_generated)

target_include_directories (${example}
SYSTEM
@@ -17,7 +17,7 @@ else () # find installation path
set (HUB hub-zeromq)

add_executable (${HUB} ${SOURCES})
add_dependencies (${HUB} kdberrors_generated)
add_dependencies (${HUB} kdberrors_generated elektra_error_codes_generated)
target_link_libraries (${HUB} ${ZMQ_LIBRARIES})
target_link_elektra (${HUB} elektra-kdb)
target_include_directories (${HUB} SYSTEM PUBLIC ${ZMQ_INCLUDE_DIRS})
@@ -13,11 +13,12 @@ set (SOURCES ${SRC_FILES} ${HDR_FILES})

if (BUILD_SHARED OR BUILD_FULL)
add_library (kdb-objects OBJECT ${SRC_FILES})
add_dependencies (kdb-objects elektra_error_codes_generated)
endif (BUILD_SHARED OR BUILD_FULL)

if (BUILD_SHARED)
add_executable (kdb $<TARGET_OBJECTS:kdb-objects>)
add_dependencies (kdb kdberrors_generated)
add_dependencies (kdb kdberrors_generated elektra_error_codes_generated)

target_link_libraries (kdb elektra-core elektra-kdb elektratools)

@@ -26,7 +27,7 @@ endif (BUILD_SHARED)

if (BUILD_FULL)
add_executable (kdb-full $<TARGET_OBJECTS:kdb-objects>)
add_dependencies (kdb-full kdberrors_generated)
add_dependencies (kdb-full kdberrors_generated elektra_error_codes_generated)

target_link_libraries (kdb-full elektra-full elektratools-full)

@@ -35,7 +36,7 @@ endif (BUILD_FULL)

if (BUILD_STATIC)
add_executable (kdb-static ${SOURCES})
add_dependencies (kdb-static kdberrors_generated)
add_dependencies (kdb-static kdberrors_generated elektra_error_codes_generated)

set_target_properties (kdb-static
PROPERTIES LINKER_LANGUAGE
@@ -64,7 +64,7 @@ else ()
qt5_add_resources (RSCS ${qt-gui_RSCS})

add_executable (qt-gui ${qt-gui_SRCS} ${qt-gui_HDRS} ${UIS} ${RSCS} ${TRS})
add_dependencies (qt-gui kdberrors_generated)
add_dependencies (qt-gui kdberrors_generated elektra_error_codes_generated)

target_link_libraries (qt-gui Qt5::Quick Qt5::Gui Qt5::Core Qt5::Qml Qt5::Widgets)

@@ -17,7 +17,7 @@ else ()
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
set (SOURCES ${HDR_FILES} ${other_sources} ${source}.cpp)
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)
target_link_libraries (${source} ${libraries})
endmacro (do_benchmark)

@@ -55,7 +55,7 @@ macro (do_test source)
add_headers (SOURCES)
add_testheaders (SOURCES)
add_executable (${source} ${SOURCES})
add_dependencies (${source} kdberrors_generated)
add_dependencies (${source} kdberrors_generated elektra_error_codes_generated)

if (INSTALL_TESTING)
install (TARGETS ${source} DESTINATION ${TARGET_TOOL_EXEC_FOLDER})
Oops, something went wrong.

0 comments on commit 2fdd87b

Please sign in to comment.