From 463e7434ee3fe50ac7016e9c08c1fb505ced4697 Mon Sep 17 00:00:00 2001 From: Hoop77 <p.badenhoop@gmx.de> Date: Mon, 18 Dec 2017 12:55:43 +0100 Subject: [PATCH] cmake: NetworkingLib creates Cmake-Config files to be able to import with find_package(NetworkingLib) --- NetworkingLib/.idea/workspace.xml | 65 ++++++++++--- NetworkingLib/CMakeLists.txt | 88 +++++++++++++++--- NetworkingLib/NetworkingLibConfig.cmake.in | 12 +++ .../NetworkingLibConfigVersion.cmake.in | 11 +++ .../CMake/NetworkingLibTargets-debug.cmake | 19 ++++ .../CMake/NetworkingLibTargets.cmake | 92 +++++++++++++++++++ .../CMakeFiles/Makefile.cmake | 5 + .../CMakeFiles/NetworkingLibConfig.cmake | 12 +++ .../cmake-build-debug/NetworkingLib.cbp | 9 ++ .../NetworkingLibConfig.cmake | 12 +++ .../NetworkingLibConfigVersion.cmake | 11 +++ .../NetworkingLibTargets.cmake | 63 +++++++++++++ .../cmake-build-debug/cmake_install.cmake | 82 +++++++++++++---- .../cmake-build-debug/install_manifest.txt | 14 +-- Protocol/CMakeLists.txt | 2 +- 15 files changed, 451 insertions(+), 46 deletions(-) create mode 100644 NetworkingLib/NetworkingLibConfig.cmake.in create mode 100644 NetworkingLib/NetworkingLibConfigVersion.cmake.in create mode 100644 NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets-debug.cmake create mode 100644 NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake create mode 100644 NetworkingLib/cmake-build-debug/CMakeFiles/NetworkingLibConfig.cmake create mode 100644 NetworkingLib/cmake-build-debug/NetworkingLibConfig.cmake create mode 100644 NetworkingLib/cmake-build-debug/NetworkingLibConfigVersion.cmake create mode 100644 NetworkingLib/cmake-build-debug/NetworkingLibTargets.cmake diff --git a/NetworkingLib/.idea/workspace.xml b/NetworkingLib/.idea/workspace.xml index ca919f28..11b2a869 100644 --- a/NetworkingLib/.idea/workspace.xml +++ b/NetworkingLib/.idea/workspace.xml @@ -26,8 +26,28 @@ <file leaf-file-name="CMakeLists.txt" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/CMakeLists.txt"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="247"> - <caret line="37" column="39" lean-forward="true" selection-start-line="37" selection-start-column="39" selection-end-line="37" selection-end-column="39" /> + <state relative-caret-position="156"> + <caret line="8" column="53" lean-forward="false" selection-start-line="8" selection-start-column="53" selection-end-line="8" selection-end-column="53" /> + <folding /> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="NetworkingLibConfig.cmake.in" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/NetworkingLibConfig.cmake.in"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="171"> + <caret line="9" column="28" lean-forward="false" selection-start-line="9" selection-start-column="28" selection-end-line="9" selection-end-column="28" /> + <folding /> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="NetworkingLibConfigVersion.cmake.in" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/NetworkingLibConfigVersion.cmake.in"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="0"> + <caret line="0" column="46" lean-forward="false" selection-start-line="0" selection-start-column="46" selection-end-line="0" selection-end-column="46" /> <folding /> </state> </provider> @@ -87,6 +107,11 @@ </file> </leaf> </component> + <component name="FindInProjectRecents"> + <findStrings> + <find>REL_INCLUDE_DIR</find> + </findStrings> + </component> <component name="IdeDocumentHistory"> <option name="CHANGED_PATHS"> <list> @@ -102,6 +127,8 @@ <option value="$PROJECT_DIR$/test/PlatoonCreateNetworkMessage.h" /> <option value="$PROJECT_DIR$/src/Config.h.in" /> <option value="$PROJECT_DIR$/include/Networking.h" /> + <option value="$PROJECT_DIR$/NetworkingLibConfigVersion.cmake.in" /> + <option value="$PROJECT_DIR$/NetworkingLibConfig.cmake.in" /> <option value="$PROJECT_DIR$/CMakeLists.txt" /> </list> </option> @@ -114,9 +141,9 @@ </component> <component name="ProjectFrameBounds" extendedState="6"> <option name="x" value="-1" /> - <option name="y" value="1080" /> + <option name="y" value="24" /> <option name="width" value="1922" /> - <option name="height" value="1081" /> + <option name="height" value="1057" /> </component> <component name="ProjectView"> <navigator currentView="ProjectPane" proportions="" version="1"> @@ -219,21 +246,21 @@ <option name="presentableId" value="Default" /> <updated>1513512049403</updated> <workItem from="1513512051120" duration="5134000" /> - <workItem from="1513544273881" duration="15168000" /> + <workItem from="1513544273881" duration="21076000" /> </task> <servers /> </component> <component name="TimeTrackingManager"> - <option name="totallyTimeSpent" value="20302000" /> + <option name="totallyTimeSpent" value="26210000" /> </component> <component name="ToolWindowManager"> - <frame x="-1" y="1080" width="1922" height="1081" extended-state="6" /> + <frame x="-1" y="24" width="1922" height="1057" extended-state="6" /> <editor active="true" /> <layout> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.184375" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> - <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32172132" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> - <window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32889345" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32983193" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32878152" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32889345" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> @@ -499,10 +526,26 @@ </state> </provider> </entry> + <entry file="file://$PROJECT_DIR$/NetworkingLibConfigVersion.cmake.in"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="0"> + <caret line="0" column="46" lean-forward="false" selection-start-line="0" selection-start-column="46" selection-end-line="0" selection-end-column="46" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/NetworkingLibConfig.cmake.in"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="171"> + <caret line="9" column="28" lean-forward="false" selection-start-line="9" selection-start-column="28" selection-end-line="9" selection-end-column="28" /> + <folding /> + </state> + </provider> + </entry> <entry file="file://$PROJECT_DIR$/CMakeLists.txt"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="247"> - <caret line="37" column="39" lean-forward="true" selection-start-line="37" selection-start-column="39" selection-end-line="37" selection-end-column="39" /> + <state relative-caret-position="156"> + <caret line="8" column="53" lean-forward="false" selection-start-line="8" selection-start-column="53" selection-end-line="8" selection-end-column="53" /> <folding /> </state> </provider> diff --git a/NetworkingLib/CMakeLists.txt b/NetworkingLib/CMakeLists.txt index 0aa0349c..c93712a9 100644 --- a/NetworkingLib/CMakeLists.txt +++ b/NetworkingLib/CMakeLists.txt @@ -21,28 +21,92 @@ find_package(Boost REQUIRED COMPONENTS system regex) # compiler flags set(CMAKE_CXX_FLAGS -pthread) -################### -# NetworkLib Target -################### +########################### +# NetworkLib Library Target +# ========================= +########################### set(SOURCE_FILES src/Networking.cpp include/Networking.h include/Utils.h include/Message.h include/ServiceClient.h include/ServiceServer.h) add_library(NetworkingLib STATIC ${SOURCE_FILES}) +# Specify public header files +set_target_properties(NetworkingLib PROPERTIES + PUBLIC_HEADER "include/Networking.h;include/Message.h;include/ServiceClient.h;include/ServiceServer.h;include/Utils.h;${CMAKE_CURRENT_BINARY_DIR}/Config.h") + target_link_libraries(NetworkingLib ${Boost_LIBRARIES}) +############################# +# Specify install directories +############################# set(INSTALL_LIB_DIR lib/NetworkingLib) -set(INSTALL_EXPORT_DIR lib/NetworkingLib/CMake) set(INSTALL_INCLUDE_DIR include/NetworkingLib) +set(INSTALL_CMAKE_DIR lib/NetworkingLib/CMake) + +# Make relative paths absolute (needed later on) +foreach(p LIB INCLUDE CMAKE) + set(var INSTALL_${p}_DIR) + if(NOT IS_ABSOLUTE "${${var}}") + set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") + endif() +endforeach() + +#################################################### +# Create the *Config.cmake and *ConfigVersion files +#################################################### +# Add all targets to the build-tree export set +export(TARGETS NetworkingLib + FILE "${PROJECT_BINARY_DIR}/NetworkingLibTargets.cmake") + +# Export the package for use from the build-tree +# (this registers the build-tree with a global CMake-registry) +export(PACKAGE NetworkingLib) + +# Get the relative path from the cmake install directory to the include install directory +file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" + "${INSTALL_INCLUDE_DIR}") + +# Configure *Config.cmake.in for the build tree +# Put it inside the binary directory +set(CONF_INCLUDE_DIRS "${}" "${PROJECT_BINARY_DIR}") +configure_file(NetworkingLibConfig.cmake.in + "${PROJECT_BINARY_DIR}/NetworkingLibConfig.cmake" + @ONLY) + +# Configure *Config.cmake.in for the install tree +# Put it inside the cmake-files directory (which is located inside the binary directory) +set(CONF_INCLUDE_DIRS "\${FOOBAR_CMAKE_DIR}/${REL_INCLUDE_DIR}") +configure_file(NetworkingLibConfig.cmake.in + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/NetworkingLibConfig.cmake" + @ONLY) + +# Configure *ConfigVersion.cmake.in for both build and install tree +# Put it inside the binary directory +configure_file(NetworkingLibConfigVersion.cmake.in + "${PROJECT_BINARY_DIR}/NetworkingLibConfigVersion.cmake" @ONLY) + +####################### +# Install NetworkingLib +####################### install(TARGETS NetworkingLib EXPORT NetworkingLibTargets - DESTINATION ${INSTALL_LIB_DIR}) -install(EXPORT NetworkingLibTargets DESTINATION ${INSTALL_EXPORT_DIR}) -install(DIRECTORY include/ DESTINATION ${INSTALL_INCLUDE_DIR}) -install(FILES ${PROJECT_BINARY_DIR}/Config.h DESTINATION ${INSTALL_INCLUDE_DIR}) - -############# -# Test Target -############# + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}") + +# Install the NetworkingLibConfig.cmake and NetworkingLibConfigVersion.cmake +install(FILES + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/NetworkingLibConfig.cmake" + "${PROJECT_BINARY_DIR}/NetworkingLibConfigVersion.cmake" + DESTINATION "${INSTALL_CMAKE_DIR}") + +# Install the export set for use with the install-tree +install(EXPORT NetworkingLibTargets + DESTINATION "${INSTALL_CMAKE_DIR}") + +######################## +# Test Executable Target +# ====================== +######################## set(TEST_SOURCE_FILES ${SOURCE_FILES} test/Test.h test/Test.cpp test/PlatoonCreateNetworkMessage.h test/PlatoonCreateNetworkService.h test/Main.cpp src/Config.h.in) add_executable(Test ${TEST_SOURCE_FILES}) diff --git a/NetworkingLib/NetworkingLibConfig.cmake.in b/NetworkingLib/NetworkingLibConfig.cmake.in new file mode 100644 index 00000000..7fe0732c --- /dev/null +++ b/NetworkingLib/NetworkingLibConfig.cmake.in @@ -0,0 +1,12 @@ +# - Config file for the NetworkingLib package +# It defines the following variable +# NETWORKINGLIB_INCLUDE_DIRS - include directories for NetworkingLib + +# Compute paths +get_filename_component(NETWORKINGLIB_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(NETWORKINGLIB_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") + +# Our library dependencies (contains definitions for IMPORTED targets) +if(NOT TARGET NetworkingLib) + include("${NETWORKINGLIB_CMAKE_DIR}/NetworkingLibTargets.cmake") +endif() \ No newline at end of file diff --git a/NetworkingLib/NetworkingLibConfigVersion.cmake.in b/NetworkingLib/NetworkingLibConfigVersion.cmake.in new file mode 100644 index 00000000..b69320bc --- /dev/null +++ b/NetworkingLib/NetworkingLibConfigVersion.cmake.in @@ -0,0 +1,11 @@ +set(PACKAGE_VERSION "@NETWORKINGLIB_VERSION@") + +# Check whether the requested PACKAGE_FIND_VERSION is compatible +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() \ No newline at end of file diff --git a/NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets-debug.cmake b/NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets-debug.cmake new file mode 100644 index 00000000..aba13f48 --- /dev/null +++ b/NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets-debug.cmake @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Debug". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "NetworkingLib" for configuration "Debug" +set_property(TARGET NetworkingLib APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) +set_target_properties(NetworkingLib PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "/usr/local/lib/NetworkingLib/libNetworkingLib.a" + ) + +list(APPEND _IMPORT_CHECK_TARGETS NetworkingLib ) +list(APPEND _IMPORT_CHECK_FILES_FOR_NetworkingLib "/usr/local/lib/NetworkingLib/libNetworkingLib.a" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake b/NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake new file mode 100644 index 00000000..8bbb6767 --- /dev/null +++ b/NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake @@ -0,0 +1,92 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + message(FATAL_ERROR "CMake >= 2.6.0 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_targetsDefined) +set(_targetsNotDefined) +set(_expectedTargets) +foreach(_expectedTarget NetworkingLib) + list(APPEND _expectedTargets ${_expectedTarget}) + if(NOT TARGET ${_expectedTarget}) + list(APPEND _targetsNotDefined ${_expectedTarget}) + endif() + if(TARGET ${_expectedTarget}) + list(APPEND _targetsDefined ${_expectedTarget}) + endif() +endforeach() +if("${_targetsDefined}" STREQUAL "${_expectedTargets}") + unset(_targetsDefined) + unset(_targetsNotDefined) + unset(_expectedTargets) + set(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT "${_targetsDefined}" STREQUAL "") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") +endif() +unset(_targetsDefined) +unset(_targetsNotDefined) +unset(_expectedTargets) + + +# The installation prefix configured by this project. +set(_IMPORT_PREFIX "/usr/local") + +# Create imported target NetworkingLib +add_library(NetworkingLib STATIC IMPORTED) + +set_target_properties(NetworkingLib PROPERTIES + INTERFACE_LINK_LIBRARIES "/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so" +) + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.") +endif() + +# Load information for each installed configuration. +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +file(GLOB CONFIG_FILES "${_DIR}/NetworkingLibTargets-*.cmake") +foreach(f ${CONFIG_FILES}) + include(${f}) +endforeach() + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(target ${_IMPORT_CHECK_TARGETS} ) + foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) + if(NOT EXISTS "${file}" ) + message(FATAL_ERROR "The imported target \"${target}\" references the file + \"${file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_IMPORT_CHECK_FILES_FOR_${target}) +endforeach() +unset(_IMPORT_CHECK_TARGETS) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/NetworkingLib/cmake-build-debug/CMakeFiles/Makefile.cmake b/NetworkingLib/cmake-build-debug/CMakeFiles/Makefile.cmake index a58c663a..9e135eb2 100644 --- a/NetworkingLib/cmake-build-debug/CMakeFiles/Makefile.cmake +++ b/NetworkingLib/cmake-build-debug/CMakeFiles/Makefile.cmake @@ -8,6 +8,8 @@ set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") set(CMAKE_MAKEFILE_DEPENDS "CMakeCache.txt" "../CMakeLists.txt" + "../NetworkingLibConfig.cmake.in" + "../NetworkingLibConfigVersion.cmake.in" "CMakeFiles/3.8.2/CMakeCCompiler.cmake" "CMakeFiles/3.8.2/CMakeCXXCompiler.cmake" "CMakeFiles/3.8.2/CMakeSystem.cmake" @@ -42,6 +44,9 @@ set(CMAKE_MAKEFILE_OUTPUTS # Byproducts of CMake generate step: set(CMAKE_MAKEFILE_PRODUCTS "Config.h" + "NetworkingLibConfig.cmake" + "CMakeFiles/NetworkingLibConfig.cmake" + "NetworkingLibConfigVersion.cmake" "CMakeFiles/CMakeDirectoryInformation.cmake" ) diff --git a/NetworkingLib/cmake-build-debug/CMakeFiles/NetworkingLibConfig.cmake b/NetworkingLib/cmake-build-debug/CMakeFiles/NetworkingLibConfig.cmake new file mode 100644 index 00000000..6464333c --- /dev/null +++ b/NetworkingLib/cmake-build-debug/CMakeFiles/NetworkingLibConfig.cmake @@ -0,0 +1,12 @@ +# - Config file for the NetworkingLib package +# It defines the following variable +# NETWORKINGLIB_INCLUDE_DIRS - include directories for NetworkingLib + +# Compute paths +get_filename_component(NETWORKINGLIB_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(NETWORKINGLIB_INCLUDE_DIRS "${FOOBAR_CMAKE_DIR}/../../../include/NetworkingLib") + +# Our library dependencies (contains definitions for IMPORTED targets) +if(NOT TARGET NetworkingLib) + include("${NETWORKINGLIB_CMAKE_DIR}/NetworkingLibTargets.cmake") +endif() diff --git a/NetworkingLib/cmake-build-debug/NetworkingLib.cbp b/NetworkingLib/cmake-build-debug/NetworkingLib.cbp index 5222e68e..ad2786dc 100644 --- a/NetworkingLib/cmake-build-debug/NetworkingLib.cbp +++ b/NetworkingLib/cmake-build-debug/NetworkingLib.cbp @@ -219,6 +219,15 @@ <Unit filename="/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/CMakeLists.txt"> <Option virtualFolder="CMake Files\"/> </Unit> + <Unit filename="/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/NetworkingLibConfig.cmake.in"> + <Option virtualFolder="CMake Files\"/> + </Unit> + <Unit filename="/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/NetworkingLibConfig.cmake.in"> + <Option virtualFolder="CMake Files\"/> + </Unit> + <Unit filename="/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/NetworkingLibConfigVersion.cmake.in"> + <Option virtualFolder="CMake Files\"/> + </Unit> <Unit filename="/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/src/Config.h.in"> <Option virtualFolder="CMake Files\src\"/> </Unit> diff --git a/NetworkingLib/cmake-build-debug/NetworkingLibConfig.cmake b/NetworkingLib/cmake-build-debug/NetworkingLibConfig.cmake new file mode 100644 index 00000000..d47b980d --- /dev/null +++ b/NetworkingLib/cmake-build-debug/NetworkingLibConfig.cmake @@ -0,0 +1,12 @@ +# - Config file for the NetworkingLib package +# It defines the following variable +# NETWORKINGLIB_INCLUDE_DIRS - include directories for NetworkingLib + +# Compute paths +get_filename_component(NETWORKINGLIB_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(NETWORKINGLIB_INCLUDE_DIRS ";/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug") + +# Our library dependencies (contains definitions for IMPORTED targets) +if(NOT TARGET NetworkingLib) + include("${NETWORKINGLIB_CMAKE_DIR}/NetworkingLibTargets.cmake") +endif() diff --git a/NetworkingLib/cmake-build-debug/NetworkingLibConfigVersion.cmake b/NetworkingLib/cmake-build-debug/NetworkingLibConfigVersion.cmake new file mode 100644 index 00000000..51cbc01e --- /dev/null +++ b/NetworkingLib/cmake-build-debug/NetworkingLibConfigVersion.cmake @@ -0,0 +1,11 @@ +set(PACKAGE_VERSION "") + +# Check whether the requested PACKAGE_FIND_VERSION is compatible +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/NetworkingLib/cmake-build-debug/NetworkingLibTargets.cmake b/NetworkingLib/cmake-build-debug/NetworkingLibTargets.cmake new file mode 100644 index 00000000..3972b3a1 --- /dev/null +++ b/NetworkingLib/cmake-build-debug/NetworkingLibTargets.cmake @@ -0,0 +1,63 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + message(FATAL_ERROR "CMake >= 2.6.0 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_targetsDefined) +set(_targetsNotDefined) +set(_expectedTargets) +foreach(_expectedTarget NetworkingLib) + list(APPEND _expectedTargets ${_expectedTarget}) + if(NOT TARGET ${_expectedTarget}) + list(APPEND _targetsNotDefined ${_expectedTarget}) + endif() + if(TARGET ${_expectedTarget}) + list(APPEND _targetsDefined ${_expectedTarget}) + endif() +endforeach() +if("${_targetsDefined}" STREQUAL "${_expectedTargets}") + unset(_targetsDefined) + unset(_targetsNotDefined) + unset(_expectedTargets) + set(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT "${_targetsDefined}" STREQUAL "") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") +endif() +unset(_targetsDefined) +unset(_targetsNotDefined) +unset(_expectedTargets) + + +# Create imported target NetworkingLib +add_library(NetworkingLib STATIC IMPORTED) + +set_target_properties(NetworkingLib PROPERTIES + INTERFACE_LINK_LIBRARIES "/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so" +) + +# Import target "NetworkingLib" for configuration "Debug" +set_property(TARGET NetworkingLib APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) +set_target_properties(NetworkingLib PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/libNetworkingLib.a" + ) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/NetworkingLib/cmake-build-debug/cmake_install.cmake b/NetworkingLib/cmake-build-debug/cmake_install.cmake index d5c441ba..39dcc330 100644 --- a/NetworkingLib/cmake-build-debug/cmake_install.cmake +++ b/NetworkingLib/cmake-build-debug/cmake_install.cmake @@ -33,36 +33,86 @@ if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) endif() if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) - file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/NetworkingLib" TYPE STATIC_LIBRARY FILES "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/libNetworkingLib.a") + list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES + "/usr/local/lib/NetworkingLib/libNetworkingLib.a") + if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) + message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() + if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) + message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() +file(INSTALL DESTINATION "/usr/local/lib/NetworkingLib" TYPE STATIC_LIBRARY FILES "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/libNetworkingLib.a") +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES + "/usr/local/include/NetworkingLib/Networking.h;/usr/local/include/NetworkingLib/Message.h;/usr/local/include/NetworkingLib/ServiceClient.h;/usr/local/include/NetworkingLib/ServiceServer.h;/usr/local/include/NetworkingLib/Utils.h;/usr/local/include/NetworkingLib/Config.h") + if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) + message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() + if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) + message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() +file(INSTALL DESTINATION "/usr/local/include/NetworkingLib" TYPE FILE FILES + "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/include/Networking.h" + "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/include/Message.h" + "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/include/ServiceClient.h" + "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/include/ServiceServer.h" + "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/include/Utils.h" + "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/Config.h" + ) +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES + "/usr/local/lib/NetworkingLib/CMake/NetworkingLibConfig.cmake;/usr/local/lib/NetworkingLib/CMake/NetworkingLibConfigVersion.cmake") + if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) + message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() + if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) + message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() +file(INSTALL DESTINATION "/usr/local/lib/NetworkingLib/CMake" TYPE FILE FILES + "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/CMakeFiles/NetworkingLibConfig.cmake" + "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/NetworkingLibConfigVersion.cmake" + ) endif() if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) - if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake") + if(EXISTS "$ENV{DESTDIR}/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake") file(DIFFERENT EXPORT_FILE_CHANGED FILES - "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake" - "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/CMakeFiles/Export/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake") + "$ENV{DESTDIR}/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake" + "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake") if(EXPORT_FILE_CHANGED) - file(GLOB OLD_CONFIG_FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/NetworkingLib/CMake/NetworkingLibTargets-*.cmake") + file(GLOB OLD_CONFIG_FILES "$ENV{DESTDIR}/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets-*.cmake") if(OLD_CONFIG_FILES) - message(STATUS "Old export file \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake\" will be replaced. Removing files [${OLD_CONFIG_FILES}].") + message(STATUS "Old export file \"$ENV{DESTDIR}/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake\" will be replaced. Removing files [${OLD_CONFIG_FILES}].") file(REMOVE ${OLD_CONFIG_FILES}) endif() endif() endif() - file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/NetworkingLib/CMake" TYPE FILE FILES "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/CMakeFiles/Export/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake") + list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES + "/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake") + if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) + message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() + if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) + message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() +file(INSTALL DESTINATION "/usr/local/lib/NetworkingLib/CMake" TYPE FILE FILES "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake") if("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Dd][Ee][Bb][Uu][Gg])$") - file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/NetworkingLib/CMake" TYPE FILE FILES "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/CMakeFiles/Export/lib/NetworkingLib/CMake/NetworkingLibTargets-debug.cmake") + list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES + "/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets-debug.cmake") + if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) + message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() + if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) + message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") + endif() +file(INSTALL DESTINATION "/usr/local/lib/NetworkingLib/CMake" TYPE FILE FILES "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/CMakeFiles/Export/_usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets-debug.cmake") endif() endif() -if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) - file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/NetworkingLib" TYPE DIRECTORY FILES "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/include/") -endif() - -if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) - file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/NetworkingLib" TYPE FILE FILES "/home/philipp/hu/Hochautomatisiertes Fahren/Gruppe-A/NetworkingLib/cmake-build-debug/Config.h") -endif() - if(CMAKE_INSTALL_COMPONENT) set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") else() diff --git a/NetworkingLib/cmake-build-debug/install_manifest.txt b/NetworkingLib/cmake-build-debug/install_manifest.txt index 319bee2e..0e22d80c 100644 --- a/NetworkingLib/cmake-build-debug/install_manifest.txt +++ b/NetworkingLib/cmake-build-debug/install_manifest.txt @@ -1,9 +1,11 @@ /usr/local/lib/NetworkingLib/libNetworkingLib.a -/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake -/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets-debug.cmake -/usr/local/include/NetworkingLib/ServiceClient.h -/usr/local/include/NetworkingLib/Message.h /usr/local/include/NetworkingLib/Networking.h -/usr/local/include/NetworkingLib/Utils.h +/usr/local/include/NetworkingLib/Message.h +/usr/local/include/NetworkingLib/ServiceClient.h /usr/local/include/NetworkingLib/ServiceServer.h -/usr/local/include/NetworkingLib/Config.h \ No newline at end of file +/usr/local/include/NetworkingLib/Utils.h +/usr/local/include/NetworkingLib/Config.h +/usr/local/lib/NetworkingLib/CMake/NetworkingLibConfig.cmake +/usr/local/lib/NetworkingLib/CMake/NetworkingLibConfigVersion.cmake +/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake +/usr/local/lib/NetworkingLib/CMake/NetworkingLibTargets-debug.cmake \ No newline at end of file diff --git a/Protocol/CMakeLists.txt b/Protocol/CMakeLists.txt index 48149869..034fbd1c 100644 --- a/Protocol/CMakeLists.txt +++ b/Protocol/CMakeLists.txt @@ -18,7 +18,7 @@ include_directories("${PROJECT_BINARY_DIR}") # compiler flags set(CMAKE_CXX_FLAGS -pthread) -include(${CMAKE_INSTALL_PREFIX}/lib/NetworkingLib/CMake/NetworkingLibTargets.cmake) +find_package(NetworkingLib REQUIRED) ######################### # Protocol Library Target -- GitLab