diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-31 21:05:47 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-31 21:05:47 (GMT) |
commit | a61ef07b5eb3dacfc596a26cb1373356e5673dbb (patch) | |
tree | 484f4c1952c493032f8ca42709e001d7cc25be6a /CMakeLists.txt | |
parent | eab5c12b2a1b9cfee94e8d0cbe41fb5d78594bb5 (diff) | |
download | uscxml-a61ef07b5eb3dacfc596a26cb1373356e5673dbb.zip uscxml-a61ef07b5eb3dacfc596a26cb1373356e5673dbb.tar.gz uscxml-a61ef07b5eb3dacfc596a26cb1373356e5673dbb.tar.bz2 |
Support for ignoring libraries when building and minimal builds
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 499 |
1 files changed, 298 insertions, 201 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cfe179c..c238d7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,6 +312,7 @@ else() endif() OPTION(ENABLE_GCOV "Compile with gcov support" OFF) +OPTION(BUILD_MINIMAL "Build only features mandated by specification" ON) OPTION(BUILD_DM_ECMA "Build with ECMAScript datamodel" ON) OPTION(BUILD_DM_XPATH "Build with XPath datamodel" ON) OPTION(BUILD_DM_PROLOG "Build with Prolog datamodel" ON) @@ -658,11 +659,21 @@ list (APPEND USCXML_CORE_LIBS ${EVENT_LIBRARY}) ################################################# # Optional libraries +OPTION(DISABLE_ALL "Ignore all optional libraries" OFF) +if (BUILD_MINIMAL) + SET(DISABLE_ALL ON) +endif() + + if (APPLE OR IOS) - find_library(AUDIOTOOLBOX AudioToolbox REQUIRED) - list (APPEND USCXML_OPT_LIBS ${AUDIOTOOLBOX}/AudioToolbox) - set(AUDIOTOOLBOX_FOUND ON) - + OPTION(DISABLE_AUDIOTOOLBOX "Ignore AudioToolbox" OFF) + if (NOT DISABLE_AUDIOTOOLBOX AND NOT DISABLE_ALL) + find_library(AUDIOTOOLBOX AudioToolbox REQUIRED) + list (APPEND USCXML_OPT_LIBS ${AUDIOTOOLBOX}/AudioToolbox) + set(AUDIOTOOLBOX_FOUND ON) + else() + set(AUDIOTOOLBOX_FOUND OFF) + endif() find_library(FOUNDATION_LIBRARY Foundation) list (APPEND USCXML_OPT_LIBS ${FOUNDATION_LIBRARY}/Foundation) @@ -676,36 +687,55 @@ if (APPLE OR IOS) endif() if (APPLE OR IOS) - find_library(JSC_LIBRARY JavaScriptCore) - list (APPEND USCXML_OPT_LIBS ${JSC_LIBRARY}) - set(JSC_FOUND ON) + OPTION(DISABLE_JSC "Ignore JavaScriptCore" OFF) + if (NOT DISABLE_JSC AND NOT DISABLE_ALL) + find_library(JSC_LIBRARY JavaScriptCore) + list (APPEND USCXML_OPT_LIBS ${JSC_LIBRARY}) + set(JSC_FOUND ON) + else() + set(JSC_FOUND OFF) + endif() else() - find_package(V8) - if (V8_FOUND) - include_directories(${V8_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${V8_LIBRARY}) + OPTION(DISABLE_V8 "Ignore Google's v8" OFF) + if (NOT DISABLE_V8 AND NOT DISABLE_ALL) + find_package(V8) + if (V8_FOUND) + include_directories(${V8_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${V8_LIBRARY}) + endif() + else() + set(V8_FOUND OFF) endif() endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(Lua) -if (LUA_FOUND) - include_directories (${LUA_INCLUDE_DIR}) - include_directories(${PROJECT_SOURCE_DIR}/contrib/src/LuaBridge) - list (APPEND USCXML_OPT_LIBS ${LUA_LIBRARIES}) -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - - -find_package(OpenSSL) -if (OPENSSL_FOUND) - set(OPENSSL_HAS_ELIPTIC_CURVES OFF) - include_directories(${OPENSSL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${OPENSSL_LIBRARIES}) - if (EXISTS ${OPENSSL_INCLUDE_DIR}/openssl/ec.h) - set(OPENSSL_HAS_ELIPTIC_CURVES ON) +OPTION(DISABLE_LUA "Ignore Lua" OFF) +if (NOT DISABLE_LUA AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(Lua) + if (LUA_FOUND) + include_directories (${LUA_INCLUDE_DIR}) + include_directories(${PROJECT_SOURCE_DIR}/contrib/src/LuaBridge) + list (APPEND USCXML_OPT_LIBS ${LUA_LIBRARIES}) endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(LUA_FOUND OFF) +endif() + +OPTION(DISABLE_SSL "Ignore OpenSSL" OFF) +if (NOT DISABLE_SSL AND NOT DISABLE_ALL) + find_package(OpenSSL) + if (OPENSSL_FOUND) + set(OPENSSL_HAS_ELIPTIC_CURVES OFF) + include_directories(${OPENSSL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${OPENSSL_LIBRARIES}) + if (EXISTS ${OPENSSL_INCLUDE_DIR}/openssl/ec.h) + set(OPENSSL_HAS_ELIPTIC_CURVES ON) + endif() + endif() +else() + set(OPENSSL_FOUND OFF) endif() if (EVENT_SSL_FOUND AND OPENSSL_FOUND) @@ -713,189 +743,254 @@ if (EVENT_SSL_FOUND AND OPENSSL_FOUND) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(SWI) -if (SWI_FOUND) - if (SWI_CPP_INCLUDE_DIR) - include_directories(${SWI_CPP_INCLUDE_DIR}) - else() - include_directories(${PROJECT_SOURCE_DIR}/contrib/src/swi-pl) - endif() - include_directories(${SWI_INCLUDE_DIR}) - if (BUILD_PREFER_STATIC_LIBRARIES) - find_package(GMP) - find_package(Curses) - if (GMP_FOUND AND CURSES_FOUND) - list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY} ${GMP_LIBRARY} ${CURSES_LIBRARIES}) +OPTION(DISABLE_SWI "Ignore SWI Prolog" OFF) +if (NOT DISABLE_SWI AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(SWI) + if (SWI_FOUND) + if (SWI_CPP_INCLUDE_DIR) + include_directories(${SWI_CPP_INCLUDE_DIR}) else() - message("Not building datamodel with static SWI without NCurses and GMP") - set(SWI_FOUND OFF) + include_directories(${PROJECT_SOURCE_DIR}/contrib/src/swi-pl) + endif() + include_directories(${SWI_INCLUDE_DIR}) + if (BUILD_PREFER_STATIC_LIBRARIES) + find_package(GMP) + find_package(Curses) + if (GMP_FOUND AND CURSES_FOUND) + list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY} ${GMP_LIBRARY} ${CURSES_LIBRARIES}) + else() + message("Not building datamodel with static SWI without NCurses and GMP") + set(SWI_FOUND OFF) + endif() + else() + list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY}) endif() - else() - list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY}) endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(SWI_FOUND OFF) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -find_package(Sqlite3) -if (SQLITE3_FOUND) -endif() - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(FFMPEG) -if (FFMPEG_FOUND) - include_directories (${FFMPEG_INCLUDE_DIRS}) - list (APPEND USCXML_OPT_LIBS ${FFMPEG_LIBRARIES}) - # required with static ffmpeg builds - # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(LIBICAL) -if (LIBICAL_FOUND) - include_directories (${LIBICAL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${LIBICAL_LIBRARIES}) -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -if (NOT DEFINED ENV{LIBJINGLE_ROOT_DIR}) - set(ENV{LIBJINGLE_ROOT_DIR} "/Users/sradomski/Documents/TK/Code/webrtc-work/trunk") -endif() - -find_package(LIBJINGLE) -if (LIBJINGLE_FOUND) - include_directories (${LIBJINGLE_INCLUDE_DIRS}) - list (APPEND USCXML_OPT_LIBS ${LIBJINGLE_LIBRARIES}) -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -find_package(Expect) -find_package(TCL) -if (EXPECT_FOUND AND TCL_FOUND) - include_directories (${EXPECT_INCLUDE_DIR}) - include_directories (${TCL_INCLUDE_PATH}) - list (APPEND USCXML_OPT_LIBS ${EXPECT_LIBRARY}) - list (APPEND USCXML_OPT_LIBS ${TCL_LIBRARY}) -endif() - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(LibPurple) -if (LIBPURPLE_FOUND) - find_package(ICONV) - find_package(GLIB2) - find_package(GObject) - if (GLIB2_FOUND AND ICONV_FOUND AND GOBJECT_FOUND) - include_directories (${LIBPURPLE_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${LIBPURPLE_LIBRARY}) - include_directories (${GLIB2_INCLUDE_DIRS}) - list (APPEND USCXML_OPT_LIBS ${GLIB2_LIBRARIES}) - include_directories (${ICONV_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${ICONV_LIBRARIES}) - include_directories (${GOBJECT_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${GOBJECT_LIBRARIES}) - else() - set(LIBPURPLE_FOUND OFF) - endif() + +OPTION(DISABLE_SQLITE "Ignore Sqlite3" OFF) +if (NOT DISABLE_SQLITE AND NOT DISABLE_ALL) + find_package(Sqlite3) + if (SQLITE3_FOUND) + endif() +else() + set(SQLITE3_FOUND OFF) +endif() + +OPTION(DISABLE_FFMPEG "Ignore FFMpeg" OFF) +if (NOT DISABLE_FFMPEG AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(FFMPEG) + if (FFMPEG_FOUND) + include_directories (${FFMPEG_INCLUDE_DIRS}) + list (APPEND USCXML_OPT_LIBS ${FFMPEG_LIBRARIES}) + # required with static ffmpeg builds + # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(FFMPEG_FOUND OFF) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +OPTION(DISABLE_ICAL "Ignore iCal" OFF) +if (NOT DISABLE_ICAL AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(LIBICAL) + if (LIBICAL_FOUND) + include_directories (${LIBICAL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${LIBICAL_LIBRARIES}) + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) -if (WIN32) - find_package(UMUNDO COMPONENTS convenience) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + if (NOT DEFINED ENV{LIBJINGLE_ROOT_DIR}) + set(ENV{LIBJINGLE_ROOT_DIR} "/Users/sradomski/Documents/TK/Code/webrtc-work/trunk") + endif() else() - find_package(UMUNDO COMPONENTS rpc serial core) - # find_package(UMUNDO COMPONENTS convenience) + set(LIBICAL_FOUND OFF) endif() -if (UMUNDO_FOUND) - include_directories (${UMUNDO_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${UMUNDO_LIBRARIES}) -# add_definitions("-DUMUNDO_STATIC") + +OPTION(DISABLE_WEBRTC "Ignore libjingle (WebRTC)" OFF) +if (NOT DISABLE_WEBRTC AND NOT DISABLE_ALL) + find_package(LIBJINGLE) + if (LIBJINGLE_FOUND) + include_directories (${LIBJINGLE_INCLUDE_DIRS}) + list (APPEND USCXML_OPT_LIBS ${LIBJINGLE_LIBRARIES}) + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(LIBJINGLE_FOUND OFF) +endif() + +OPTION(DISABLE_EXPECT "Ignore TCL/Expect" OFF) +if (NOT DISABLE_EXPECT AND NOT DISABLE_ALL) + find_package(Expect) + find_package(TCL) + if (EXPECT_FOUND AND TCL_FOUND) + include_directories (${EXPECT_INCLUDE_DIR}) + include_directories (${TCL_INCLUDE_PATH}) + list (APPEND USCXML_OPT_LIBS ${EXPECT_LIBRARY}) + list (APPEND USCXML_OPT_LIBS ${TCL_LIBRARY}) + endif() +else() + set(EXPECT_FOUND OFF) + set(TCL_FOUND OFF) endif() -if (UNIX) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) # link dynamically! -elseif(WIN32) - if (ENV{OSG_ROOT} STREQUAL "") - set(ENV{OSG_ROOT} "C:/Program Files/OpenSceneGraph-3.0.1") +OPTION(DISABLE_LIBPURPLE "Ignore libpurple (instant messaging)" OFF) +if (NOT DISABLE_LIBPURPLE AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(LibPurple) + if (LIBPURPLE_FOUND) + find_package(ICONV) + find_package(GLIB2) + find_package(GObject) + if (GLIB2_FOUND AND ICONV_FOUND AND GOBJECT_FOUND) + include_directories (${LIBPURPLE_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${LIBPURPLE_LIBRARY}) + include_directories (${GLIB2_INCLUDE_DIRS}) + list (APPEND USCXML_OPT_LIBS ${GLIB2_LIBRARIES}) + include_directories (${ICONV_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${ICONV_LIBRARIES}) + include_directories (${GOBJECT_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${GOBJECT_LIBRARIES}) + else() + set(LIBPURPLE_FOUND OFF) + endif() endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(LIBPURPLE_FOUND OFF) endif() -find_package(OpenSceneGraph COMPONENTS osgViewer osgGA osgText osgFX osgManipulator osgDB osgUtil OpenThreads) -find_package(OpenGL) -if (OPENSCENEGRAPH_FOUND AND OPENGL_FOUND) - include_directories (${OPENSCENEGRAPH_INCLUDE_DIRS}) - include_directories (${OPENGL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${OPENSCENEGRAPH_LIBRARIES} ${OPENGL_LIBRARIES}) -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -set(CMAKE_FIND_FRAMEWORK "FIRST") -find_package(OpenAL) -if (OPENAL_FOUND) - list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) - if (APPLE OR IOS) - list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}/OpenAL) + +OPTION(DISABLE_UMUNDO "Ignore uMundo" OFF) +if (NOT DISABLE_UMUNDO AND NOT DISABLE_ALL) + if (WIN32) + find_package(UMUNDO COMPONENTS convenience) else() - list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + find_package(UMUNDO COMPONENTS rpc serial core) + # find_package(UMUNDO COMPONENTS convenience) + endif() + if (UMUNDO_FOUND) + include_directories (${UMUNDO_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${UMUNDO_LIBRARIES}) + # add_definitions("-DUMUNDO_STATIC") + endif() +else() + set(UMUNDO_FOUND OFF) +endif() + +OPTION(DISABLE_OSG "Ignore OpenSceneGraph" OFF) +if (NOT DISABLE_OSG AND NOT DISABLE_ALL) + if (UNIX) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) # link dynamically! + elseif(WIN32) + if (ENV{OSG_ROOT} STREQUAL "") + set(ENV{OSG_ROOT} "C:/Program Files/OpenSceneGraph-3.0.1") + endif() + endif() + find_package(OpenSceneGraph COMPONENTS osgViewer osgGA osgText osgFX osgManipulator osgDB osgUtil OpenThreads) + find_package(OpenGL) + if (OPENSCENEGRAPH_FOUND AND OPENGL_FOUND) + include_directories (${OPENSCENEGRAPH_INCLUDE_DIRS}) + include_directories (${OPENGL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${OPENSCENEGRAPH_LIBRARIES} ${OPENGL_LIBRARIES}) endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) else() - find_package(OpenALKCAT) + set(OPENSCENEGRAPH_FOUND OFF) + set(OPENGL_FOUND OFF) +endif() + +OPTION(DISABLE_OPENAL "Ignore OpenAL" OFF) +if (NOT DISABLE_OPENAL AND NOT DISABLE_ALL) + set(CMAKE_FIND_FRAMEWORK "FIRST") + find_package(OpenAL) if (OPENAL_FOUND) list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + if (APPLE OR IOS) + list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}/OpenAL) + else() + list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + endif() + else() + find_package(OpenALKCAT) + if (OPENAL_FOUND) + list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + endif() endif() + set(CMAKE_FIND_FRAMEWORK "LAST") +else() + set(OPENAL_FOUND OFF) endif() -set(CMAKE_FIND_FRAMEWORK "LAST") if (NOT AUDIOTOOLBOX_FOUND) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) - find_package(LIBSNDFILE) - if (LIBSNDFILE_FOUND) - list (APPEND USCXML_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${LIBSNDFILE_LIBRARY}) + OPTION(DISABLE_LIBSNDFILE "Ignore libsndfile" OFF) + if (NOT DISABLE_LIBSNDFILE AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(LIBSNDFILE) + if (LIBSNDFILE_FOUND) + list (APPEND USCXML_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${LIBSNDFILE_LIBRARY}) + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) + else() + set(LIBSNDFILE_FOUND OFF) endif() - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(MILES) -#set(JPEG_ROOT_PATH "" CACHE STRING "Where to find libjpeg") -if (MILES_FOUND) - - if (NOT WIN32) - # openal is only needed for miles - find_package(OpenAL) - find_package(JPEG) - find_package(ICONV) +OPTION(DISABLE_MILES "Ignore miles" OFF) +if (NOT DISABLE_MILES AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(MILES) + #set(JPEG_ROOT_PATH "" CACHE STRING "Where to find libjpeg") + if (MILES_FOUND) + if (NOT WIN32) + # openal is only needed for miles + find_package(OpenAL) + find_package(JPEG) + find_package(ICONV) - if (OPENAL_FOUND AND ICONV_FOUND AND JPEG_FOUND) + if (OPENAL_FOUND AND ICONV_FOUND AND JPEG_FOUND) + include_directories (${MILES_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${MILES_LIBRARIES}) + include_directories (${ICONV_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${ICONV_LIBRARIES}) + include_directories (${JPEG_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${JPEG_LIBRARIES}) + include_directories (${OPENAL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + else() + set(MILES_FOUND OFF) + endif() + else() include_directories (${MILES_INCLUDE_DIR}) list (APPEND USCXML_OPT_LIBS ${MILES_LIBRARIES}) - include_directories (${ICONV_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${ICONV_LIBRARIES}) - include_directories (${JPEG_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${JPEG_LIBRARIES}) - include_directories (${OPENAL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) - else() - set(MILES_FOUND OFF) endif() - else() - include_directories (${MILES_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${MILES_LIBRARIES}) endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(MILES_FOUND OFF) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(Protobuf) -if (PROTOBUF_FOUND) - include_directories(${PROTOBUF_INCLUDE_DIRS}) - LIST(APPEND USCXML_OPT_LIBS optimized ${PROTOBUF_LIBRARY}) - LIST(APPEND USCXML_OPT_LIBS debug ${PROTOBUF_LIBRARY_DEBUG}) +OPTION(DISABLE_PROTOBUF "Ignore protobuf" OFF) +if (NOT DISABLE_PROTOBUF AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(Protobuf) + if (PROTOBUF_FOUND) + include_directories(${PROTOBUF_INCLUDE_DIRS}) + LIST(APPEND USCXML_OPT_LIBS optimized ${PROTOBUF_LIBRARY}) + LIST(APPEND USCXML_OPT_LIBS debug ${PROTOBUF_LIBRARY_DEBUG}) + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(PROTOBUF_FOUND OFF) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) ################################################# # Gather source files @@ -1028,33 +1123,35 @@ if (NOT CMAKE_CROSSCOMPILING) set_target_properties(uscxml-browser PROPERTIES FOLDER "Apps") install_executable(TARGETS uscxml-browser COMPONENT tools) - if (WIN32) - add_executable(uscxml-transform apps/uscxml-transform.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c) - else() - add_executable(uscxml-transform apps/uscxml-transform.cpp) - endif() - target_link_libraries(uscxml-transform uscxml) - if (NOT CMAKE_CROSSCOMPILING) - if (ENABLE_COTIRE) - set_target_properties(uscxml-transform PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) + if (NOT BUILD_MINIMAL) + if (WIN32) + add_executable(uscxml-transform apps/uscxml-transform.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c) + else() + add_executable(uscxml-transform apps/uscxml-transform.cpp) endif() - endif() - set_target_properties(uscxml-transform PROPERTIES FOLDER "Apps") - install_executable(TARGETS uscxml-transform COMPONENT tools) + target_link_libraries(uscxml-transform uscxml) + if (NOT CMAKE_CROSSCOMPILING) + if (ENABLE_COTIRE) + set_target_properties(uscxml-transform PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) + endif() + endif() + set_target_properties(uscxml-transform PROPERTIES FOLDER "Apps") + install_executable(TARGETS uscxml-transform COMPONENT tools) - if (WIN32) - add_executable(uscxml-dot apps/uscxml-dot.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c) - else() - add_executable(uscxml-dot apps/uscxml-dot.cpp) - endif() - target_link_libraries(uscxml-dot uscxml) - if (NOT CMAKE_CROSSCOMPILING) - if (ENABLE_COTIRE) - set_target_properties(uscxml-dot PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) + if (WIN32) + add_executable(uscxml-dot apps/uscxml-dot.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c) + else() + add_executable(uscxml-dot apps/uscxml-dot.cpp) + endif() + target_link_libraries(uscxml-dot uscxml) + if (NOT CMAKE_CROSSCOMPILING) + if (ENABLE_COTIRE) + set_target_properties(uscxml-dot PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) + endif() endif() + set_target_properties(uscxml-dot PROPERTIES FOLDER "Apps") + install_executable(TARGETS uscxml-dot COMPONENT tools) endif() - set_target_properties(uscxml-dot PROPERTIES FOLDER "Apps") - install_executable(TARGETS uscxml-dot COMPONENT tools) if (PROTOBUF_FOUND AND OFF) file(GLOB W3C-MMI-COMMON ${PROJECT_SOURCE_DIR}/apps/w3c-mmi/*.cpp ${PROJECT_SOURCE_DIR}/apps/w3c-mmi/*.h) |