Procházet zdrojové kódy

build/cmake: do not include non-existent open62541 folder in amalgamated builds

This breaks cmake builds with:

CMake Error in CMakeLists.txt:
Imported target "open62541" includes non-existent path "$includedir/open62541"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
...

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Tobias Klausmann před 6 roky
rodič
revize
7fad87d951
1 změnil soubory, kde provedl 9 přidání a 0 odebrání
  1. 9 0
      CMakeLists.txt

+ 9 - 0
CMakeLists.txt

@@ -992,12 +992,21 @@ if(UA_ENABLE_DISCOVERY_MULTICAST)
 endif()
 
 # export library (either static or shared depending on BUILD_SHARED_LIBS)
+if(NOT UA_ENABLE_AMALGAMATION)
 install(TARGETS open62541
         EXPORT open62541Targets
         LIBRARY DESTINATION ${LIB_INSTALL_DIR}
         ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
         RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
         INCLUDES DESTINATION include/open62541 include)
+else()
+install(TARGETS open62541
+        EXPORT open62541Targets
+        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+        RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
+        INCLUDES DESTINATION include)
+endif()
 
 include(CMakePackageConfigHelpers)
 configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/open62541Config.cmake.in"