Add definition to divide c, c++. 58/73858/2
authorWoochan Lee <wc0917.lee@samsung.com>
Fri, 10 Jun 2016 00:58:07 +0000 (09:58 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Fri, 10 Jun 2016 01:00:41 +0000 (10:00 +0900)
Change-Id: Ica09f72e8db1152b33cb733ed74ea009ff0a55a5

CMakeLists.txt
packaging/ui-viewmgr.spec
src/CMakeLists.txt
src/examples/efl/c/main.cpp
src/examples/efl/cpp/page1.h
src/include/ui_viewmanager.h
src/lib/CMakeLists.txt

index 6e8c9e783705d5a8cb2c41ea830fb735cd3e3b53..f9ea537bc9929c025dfe5c26295e571f26757faa 100644 (file)
@@ -27,6 +27,10 @@ ADD_DEFINITIONS("-DVERSION=\"${VERSION}\"")
 ADD_DEFINITIONS("-DBINNAME=\"${BINNAME}\"")
 ADD_DEFINITIONS("-DLOCALE_DIR=\"${LOCALEDIR}\"")
 
+IF("${TARGET_LANGUAGE}" STREQUAL "c")
+       ADD_DEFINITIONS(-DTARGET_LANG_C)
+ENDIF()
+
 INCLUDE(FindPkgConfig)
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -O2 -Wall -fPIE")
index fc6d93556395c887a78599ad9094bda90d0bb348..3c02f453bb9a9d72cbfccfd0c44acf798a1712f7 100644 (file)
@@ -39,6 +39,13 @@ UI VIEW MANAGER library providing View management functionality(devel)
 %setup -q
 
 %build
+
+%if "%{?target_language}" == "c"
+    cmake . -DTARGET_LANGUAGE="c"
+%else
+    cmake . -DTARGET_LANGUAGE="c++"
+%endif
+
 cmake . -DCMAKE_INSTALL_PREFIX=/usr
 make %{?jobs:-j%jobs}
 
index 48ed9d5f3b9e76d6a6202bdb7f3c3bcaf757939e..7824ef42d590e7d371b3829f1cf36a9b2a911249 100644 (file)
@@ -3,5 +3,9 @@ LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/lib)
 
 ADD_SUBDIRECTORY(include)
 ADD_SUBDIRECTORY(lib)
-ADD_SUBDIRECTORY(examples/efl/cpp)
-#ADD_SUBDIRECTORY(examples/efl/c)
+
+IF("${TARGET_LANGUAGE}" STREQUAL "c")
+       ADD_SUBDIRECTORY(examples/efl/c)
+ELSE()
+       ADD_SUBDIRECTORY(examples/efl/cpp)
+ENDIF()
index c155c8dc31e467c63957806a3f66a8cde123b83b..e4e17d0e72c3780c391d683382b87cdb99e971b3 100644 (file)
@@ -1174,7 +1174,7 @@ view1_load_cb(ui_view *view, void *data)
        Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Basic View",
                        view1_prev_btn_clicked_cb, view1_next_btn_clicked_cb);
 
-       ui_standard_view_content_set(view, content, "Page1", NULL, NULL, NULL);
+       ui_standard_view_content_set(view, content, "Page1 C example", NULL, NULL, NULL);
 
        return true;
 }
index 97c17015aa0a688ad006602394015c86189e8fea..b7b6046b9e2bcad82c53abc142f399f2aac18de1 100644 (file)
@@ -38,7 +38,7 @@ protected:
                                {
                                        UI_VIEWMGR->push_view(new page2());
                                });
-               this->set_content(content, "Page1");
+               this->set_content(content, "Page1 C++ example");
        }
 
 public:
index e1fbd09e87aeb44fda08458505db2acb6274c147..73dbec4bd2677903a373e998800cc80b5e773673 100644 (file)
@@ -14,6 +14,9 @@
  *  limitations under the License.
  *
  */
-//FIXME: C++ app include below.
-#include "efl/mobile/ui_mobile_viewmanager.h"
-//#include "efl/mobile/c/ui_mobile_viewmanager.h"
+
+#ifdef TARGET_LANG_C
+       #include "efl/mobile/c/ui_mobile_viewmanager.h"
+#else
+       #include "efl/mobile/ui_mobile_viewmanager.h"
+#endif
index 65d82923351f78f92d6a1c0642654297d2abeaea..c449a2bae5f18a1f12249873f730247256b157b6 100644 (file)
@@ -1,3 +1,4 @@
+IF("${TARGET_LANGUAGE}" STREQUAL "c")
 SET(SRCS
      interface/ui_iface_overlay.cpp
      interface/ui_iface_view.cpp
@@ -14,12 +15,31 @@ SET(SRCS
      efl/mobile/ui_standard_view.cpp
      efl/mobile/ui_key_listener.cpp
      efl/mobile/ui_viewmgr.cpp
-#     efl/mobile/c/ui_app.cpp
-#     efl/mobile/c/ui_menu.cpp
-#     efl/mobile/c/ui_popup.cpp
-#     efl/mobile/c/ui_view.cpp
-#     efl/mobile/c/ui_viewmgr.cpp
+     efl/mobile/c/ui_app.cpp
+     efl/mobile/c/ui_menu.cpp
+     efl/mobile/c/ui_popup.cpp
+     efl/mobile/c/ui_view.cpp
+     efl/mobile/c/ui_viewmgr.cpp
     )
+ELSE()
+SET(SRCS
+     interface/ui_iface_overlay.cpp
+     interface/ui_iface_view.cpp
+     interface/ui_iface_viewmgr.cpp
+     interface/ui_iface_app.cpp
+     efl/ui_base_view.cpp
+     efl/ui_base_viewmgr.cpp
+     efl/ui_base_key_listener.cpp
+     efl/ui_base_overlay.cpp
+     efl/mobile/ui_app.cpp
+     efl/mobile/ui_menu.cpp
+     efl/mobile/ui_popup.cpp
+     efl/mobile/ui_view.cpp
+     efl/mobile/ui_standard_view.cpp
+     efl/mobile/ui_key_listener.cpp
+     efl/mobile/ui_viewmgr.cpp
+    )
+ENDIF()
 
 ADD_LIBRARY(${LIBNAME} SHARED ${SRCS})
 ADD_DEFINITIONS("-DEXPORT_API=__attribute__((visibility(\"default\")))")