summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMatthias Gabriel <matthias.gabriel@etit.tu-chemnitz.de>2017-03-06 08:24:12 (GMT)
committerMatthias Gabriel <matthias.gabriel@etit.tu-chemnitz.de>2017-03-06 08:24:12 (GMT)
commit7006652c1009742b505bb865e2d799b2ad3d74b2 (patch)
treed97b173122429f30e1349bb14ba3d3d6de974414 /CMakeLists.txt
parent8309a44ea39608f3e2adb60e7cad3e03fa2b1df6 (diff)
downloaduscxml-7006652c1009742b505bb865e2d799b2ad3d74b2.zip
uscxml-7006652c1009742b505bb865e2d799b2ad3d74b2.tar.gz
uscxml-7006652c1009742b505bb865e2d799b2ad3d74b2.tar.bz2
Allow external uriparser to be used
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 18 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd14bda..8a5bbbd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -304,16 +304,23 @@ if (UNIX)
list (APPEND USCXML_CORE_LIBS "pthread")
endif()
+
# uriparser
-include("${CMAKE_MODULE_PATH}/BuildURIParser.cmake")
-message(STATUS "Did not look for UriParser")
-message(STATUS "--> will download and compile")
-if (URIPARSER_BUILT)
- include_directories(${URIPARSER_INCLUDE_DIR})
- list (APPEND USCXML_CORE_LIBS ${URIPARSER_LIBRARY})
- list (APPEND USCXML_PREREQS uriparser)
+find_package(uriparser)
+if(URIPARSER_FOUND)
+ include_directories(${URIPARSER_INCLUDE_DIRS})
+ list (APPEND USCXML_CORE_LIBS ${URIPARSER_LIBRARIES})
else()
- message(FATAL_ERROR "Could not build uriparser")
+ message(STATUS "Did not find UriParser")
+ message(STATUS "--> will download and compile")
+ include("${CMAKE_MODULE_PATH}/BuildURIParser.cmake")
+ if (URIPARSER_BUILT)
+ include_directories(${URIPARSER_INCLUDE_DIR})
+ list (APPEND USCXML_CORE_LIBS ${URIPARSER_LIBRARY})
+ list (APPEND USCXML_PREREQS uriparser)
+ else()
+ message(FATAL_ERROR "Could not find or build uriparser")
+ endif()
endif()
@@ -437,7 +444,9 @@ endif()
set_property(TARGET uscxml PROPERTY CXX_STANDARD 11)
set_property(TARGET uscxml PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET uscxml PROPERTY SOVERSION ${USCXML_VERSION})
-add_dependencies(uscxml ${USCXML_PREREQS})
+if (USCXML_PREREQS)
+ add_dependencies(uscxml ${USCXML_PREREQS})
+endif()
install_library(TARGETS uscxml)