diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 27 |
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) |