THRIFT-4750: as3 changes to build and publish to maven central
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 8e334d9..2c8ea50 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -28,7 +28,6 @@
 if(BUILD_COMPILER OR EXISTS ${THRIFT_COMPILER})
     set(HAVE_COMPILER ON)
 endif()
-CMAKE_DEPENDENT_OPTION(BUILD_EXAMPLES "Build examples" ON "HAVE_COMPILER" OFF)
 CMAKE_DEPENDENT_OPTION(BUILD_TESTING "Build with unit tests" ON "HAVE_COMPILER" OFF)
 CMAKE_DEPENDENT_OPTION(BUILD_TUTORIALS "Build Thrift tutorials" ON "HAVE_COMPILER" OFF)
 option(BUILD_LIBRARIES "Build Thrift libraries" ON)
@@ -45,6 +44,15 @@
     add_definitions(-DBOOST_TEST_DYN_LINK)
 endif()
 
+# as3
+option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON)
+if (WITH_AS3)
+    set(POSSIBLE_PATHS "${FLEX_HOME}/bin" "$ENV{FLEX_HOME}/bin")
+    find_program(HAVE_COMPC NAMES compc HINTS ${POSSIBLE_PATHS})
+endif ()
+CMAKE_DEPENDENT_OPTION(BUILD_AS3 "Build as3 library" ON
+                       "BUILD_LIBRARIES;WITH_AS3;HAVE_COMPC" OFF)
+
 # C++
 option(WITH_CPP "Build C++ Thrift library" ON)
 if(WITH_CPP)
@@ -82,10 +90,6 @@
 CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON
                        "BUILD_LIBRARIES;WITH_C_GLIB;GLIB_FOUND" OFF)
 
-	       #if(BUILD_C_GLIB AND BUILD_TESTING)
-	       #    find_package(Boost 1.53 REQUIRED)
-	       #endif()
-
 # Java
 option(WITH_JAVA "Build Java Thrift library" ON)
 if(ANDROID)
@@ -148,14 +152,15 @@
 if (UNIX)
     message(STATUS "  Build type:                                 ${CMAKE_BUILD_TYPE}")
 endif ()
-message(STATUS "  Build Thrift compiler:                      ${BUILD_COMPILER}")
+message(STATUS "  Build compiler:                             ${BUILD_COMPILER}")
 message(STATUS "  Build compiler plugin support:              ${WITH_PLUGIN}")
-message(STATUS "  Build with unit tests:                      ${BUILD_TESTING}")
+message(STATUS "  Build libraries:                            ${BUILD_LIBRARIES}")
+message(STATUS "  Build tests:                                ${BUILD_TESTING}")
 MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT_COMPILER is given")
-message(STATUS "  Build examples:                             ${BUILD_EXAMPLES}")
-MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT_COMPILER is given")
-message(STATUS "  Build Thrift libraries:                     ${BUILD_LIBRARIES}")
 message(STATUS " Language libraries:")
+message(STATUS "  Build as3 library:                          ${BUILD_AS3}")
+MESSAGE_DEP(WITH_AS3 "Disabled by WITH_AS3=OFF")
+MESSAGE_DEP(HAVE_COMPC "Adobe Flex compc was not found - did you set env var FLEX_HOME?")
 message(STATUS "  Build C++ library:                          ${BUILD_CPP}")
 MESSAGE_DEP(WITH_CPP "Disabled by WITH_CPP=OFF")
 message(STATUS "    C++ Language Level:                       ${CXX_LANGUAGE_LEVEL}")