#------------------------------------------------------------------- # This file is part of the CMake build system for Scol # # The contents of this file are placed in the public domain. Feel # free to make use of it in any way you like. #------------------------------------------------------------------- ############################################################ # include/Scol core library ############################################################ PROJECT(libos2d24) if (NOT ANDROID) if (Scol_BUILD_WITH_QT) set(SCOL_USE_QT TRUE) elseif (Scol_BUILD_WITH_SDL) set(SCOL_USE_SDL TRUE) elseif (UNIX OR APPLE) # default set(SCOL_USE_QT TRUE) endif() endif(NOT ANDROID) # define header and source files for the library set (LIBOS2D24_HEADER_FILES include/active.h include/chainedlist.h include/colors.h include/debug.h include/events.h include/help.h include/importAPI2d.h include/jcomp.h include/jdecomp.h include/KEYSYMDE.H include/loadbmp.h include/macros.h include/mjpeg.h include/Objstr.h #include/osversion.h include/performanceinfo.h #include/popfile.h include/printer.h include/readpng.h include/scolsys.h include/tests.h include/utils.h ) if (Scol_STATIC) set(LIBOS2D24_HEADER_FILES ${LIBOS2D24_HEADER_FILES} include/loadScolLib2DOS.h) endif() set (LIBOS2D24_SOURCE_FILES #src/active.cpp src/alphaBlit.cpp src/chainedlist.cpp src/classicBlit.cpp src/colors.cpp #src/divers.cpp # Moved to objects/ (OS-specific) #src/events.cpp src/help.cpp src/jcomp.cpp src/jdecomp.cpp src/load2d.cpp src/loadbmp.cpp src/main.cpp src/mjpeg.cpp #src/popfile.cpp #src/osversion.cpp src/performanceinfo.cpp src/printer.cpp src/readpng.cpp src/tests.cpp src/utils.cpp ) set (LIBOS2D24_LOAD_HEADER_FILES include/load/load2d.h include/load/load_active.h include/load/load_alphabitmap.h include/load/load_bitmap.h include/load/load_bitmaplist.h include/load/load_button.h include/load/load_colors.h include/load/load_combo.h include/load/load_consts.h include/load/load_cursor.h include/load/load_divers.h include/load/load_font.h include/load/load_header.h include/load/load_help.h include/load/load_listbox.h include/load/load_listtab.h include/load/load_menu.h include/load/load_mjpeg.h include/load/load_mmedia.h include/load/load_osversion.h include/load/load_popfile.h include/load/load_printer.h include/load/load_richtext.h include/load/load_rmtctrl.h include/load/load_sound.h include/load/load_tab.h include/load/load_taskicon.h include/load/load_text.h include/load/load_tree.h include/load/load_types.h include/load/load_video.h include/load/load_win.h ) set (LIBOS2D24_OBJECTS_HEADER_FILES include/objects/active.h include/objects/alphabitmap.h include/objects/bitmap.h include/objects/bitmaplist.h include/objects/button.h include/objects/checkbox.h include/objects/colors.h include/objects/combo.h include/objects/cursor.h include/objects/divers.h include/objects/font.h include/objects/header.h include/objects/listbox.h include/objects/listtab.h include/objects/menu.h include/objects/mjpeg.h include/objects/mmedia.h include/objects/osversion.h include/objects/popfile.h include/objects/richtext.h include/objects/rmtctrl.h include/objects/tab.h include/objects/taskicon.h include/objects/text.h include/objects/tooltip.h include/objects/tree.h include/objects/win.h include/objects/win_events.h include/objects/win_trans.h ) set (LIBOS2D24_OBJECTS_SOURCE_DIR "src/objects") if (SCOL_USE_QT) set (LIBOS2D24_OBJECTS_SOURCE_DIR "${LIBOS2D24_OBJECTS_SOURCE_DIR}/qt") elseif (SCOL_USE_SDL) set (LIBOS2D24_OBJECTS_SOURCE_DIR "${LIBOS2D24_OBJECTS_SOURCE_DIR}/sdl") elseif (ANDROID) set (LIBOS2D24_OBJECTS_SOURCE_DIR "${LIBOS2D24_OBJECTS_SOURCE_DIR}/android") elseif (WIN32) set (LIBOS2D24_OBJECTS_SOURCE_DIR "${LIBOS2D24_OBJECTS_SOURCE_DIR}/windows") endif() set (LIBOS2D24_OBJECTS_SOURCE_FILES ${LIBOS2D24_OBJECTS_SOURCE_DIR}/active.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/alphaBitmap.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/bitmap.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/bitmaplist.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/button.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/checkbox.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/combo.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/cursor.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/divers.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/events.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/font.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/header.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/listbox.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/listtab.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/menu.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/mmedia.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/osversion.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/Popfile.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/richtext.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/rmtctrl.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/tab.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/taskicon.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/text.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/tooltip.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/tree.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/win.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/win_events.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/win_trans.cpp ) if (SCOL_USE_QT) set (LIBOS2D24_OBJECTS_HEADER_FILES ${LIBOS2D24_OBJECTS_HEADER_FILES} include/objects/qt/ScolQtWindow.h include/objects/qt/ScolQtMsgBox.h include/objects/qt/ScolQtFileDialog.h include/objects/qt/ScolQtButton.h include/objects/qt/ScolQtCheckBox.h include/objects/qt/ScolQtText.h ) set(LIBOS2D24_OBJECTS_SOURCE_FILES ${LIBOS2D24_OBJECTS_SOURCE_FILES} ${LIBOS2D24_OBJECTS_SOURCE_DIR}/ScolQtWindow.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/ScolQtMsgBox.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/ScolQtFileDialog.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/ScolQtButton.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/ScolQtCheckBox.cpp ${LIBOS2D24_OBJECTS_SOURCE_DIR}/ScolQtText.cpp ) elseif (SCOL_USE_SDL) set (LIBOS2D24_OBJECTS_HEADER_FILES ${LIBOS2D24_OBJECTS_HEADER_FILES} include/objects/sdl/ScolSdlWindow.h ) set(LIBOS2D24_OBJECTS_SOURCE_FILES ${LIBOS2D24_OBJECTS_SOURCE_FILES} ${LIBOS2D24_OBJECTS_SOURCE_DIR}/ScolSdlWindow.cpp ) endif() # add lib2D graphic dummies if (NOT WIN32) set (LIBOS2D24_OBJECTS_SOURCE_FILES ${LIBOS2D24_OBJECTS_SOURCE_FILES} ${LIBOS2D24_OBJECTS_SOURCE_DIR}/lib2dg_DONTDELETE.cpp) endif () set (LIBOS2D24_SOUNDS_HEADER_FILES include/sound/audiocmp.h include/sound/sound.h #include/sound/wave.h ) set (LIBOS2D24_SOUNDS_SOURCE_DIR "src/sound") if (WIN32) set (LIBOS2D24_SOUNDS_SOURCE_DIR "${LIBOS2D24_SOUNDS_SOURCE_DIR}/windows") elseif (ANDROID) set (LIBOS2D24_SOUNDS_SOURCE_DIR "${LIBOS2D24_SOUNDS_SOURCE_DIR}/android") elseif (APPLE AND NOT APPLE_IOS) set (LIBOS2D24_SOUNDS_SOURCE_DIR "${LIBOS2D24_SOUNDS_SOURCE_DIR}/OSX") elseif (APPLE_IOS) set (LIBOS2D24_SOUNDS_SOURCE_DIR "${LIBOS2D24_SOUNDS_SOURCE_DIR}/IOS") elseif (UNIX OR RPI) set (LIBOS2D24_SOUNDS_SOURCE_DIR "${LIBOS2D24_SOUNDS_SOURCE_DIR}/linux") endif() set (LIBOS2D24_SOUNDS_SOURCE_FILES ${LIBOS2D24_SOUNDS_SOURCE_DIR}/audiocmp.cpp ${LIBOS2D24_SOUNDS_SOURCE_DIR}/sound.cpp #${LIBOS2D24_SOUNDS_SOURCE_DIR}/wave.cpp ) set (LIBOS2D24_VIDEO_HEADER_FILES include/video/video.h ) set (LIBOS2D24_VIDEO_SOURCE_DIR "src/video") if (WIN32) set (LIBOS2D24_VIDEO_SOURCE_DIR "${LIBOS2D24_VIDEO_SOURCE_DIR}/windows") elseif (ANDROID) set (LIBOS2D24_VIDEO_SOURCE_DIR "${LIBOS2D24_VIDEO_SOURCE_DIR}/android") elseif (APPLE AND NOT APPLE_IOS) set (LIBOS2D24_VIDEO_SOURCE_DIR "${LIBOS2D24_VIDEO_SOURCE_DIR}/OSX") elseif (APPLE_IOS) set (LIBOS2D24_VIDEO_SOURCE_DIR "${LIBOS2D24_VIDEO_SOURCE_DIR}/IOS") elseif (UNIX OR RPI) set (LIBOS2D24_VIDEO_SOURCE_DIR "${LIBOS2D24_VIDEO_SOURCE_DIR}/linux") endif() set (LIBOS2D24_VIDEO_SOURCE_FILES ${LIBOS2D24_VIDEO_SOURCE_DIR}/video.cpp ) set (GSMCODEC_HEADER_FILES gsmcodec/config.h gsmcodec/gsm.h gsmcodec/private.h gsmcodec/proto.h gsmcodec/unproto.h ) set (GSMCODEC_SOURCE_FILES gsmcodec/add.cpp gsmcodec/code.cpp gsmcodec/debug.cpp gsmcodec/decode.cpp gsmcodec/gsm_crea.cpp gsmcodec/gsm_deco.cpp gsmcodec/gsm_dest.cpp gsmcodec/gsm_enco.cpp gsmcodec/gsm_expl.cpp gsmcodec/gsm_impl.cpp gsmcodec/gsm_opti.cpp gsmcodec/gsm_prin.cpp gsmcodec/long_ter.cpp gsmcodec/lpc.cpp gsmcodec/preproce.cpp gsmcodec/rpe.cpp gsmcodec/short_te.cpp gsmcodec/table.cpp ) scol_include_plugin("LIB2DOS" "${PROJECT_SOURCE_DIR}/include" "loadScolLib2DOS.h") # This is how visual studio directories (or filters) are generated. source_group(Header\ Files\\load FILES ${LIBOS2D24_LOAD_HEADER_FILES}) source_group(Header\ Files\\objects FILES ${LIBOS2D24_OBJECTS_HEADER_FILES}) source_group(Header\ Files\\sounds FILES ${LIBOS2D24_SOUNDS_HEADER_FILES}) source_group(Header\ Files\\video FILES ${LIBOS2D24_VIDEO_HEADER_FILES}) source_group(Header\ Files\\gsmcodec FILES ${GSMCODEC_HEADER_FILES}) # Same thing for sources files source_group(Source\ Files\\objects FILES ${LIBOS2D24_OBJECTS_SOURCE_FILES}) source_group(Source\ Files\\sounds FILES ${LIBOS2D24_SOUNDS_SOURCE_FILES}) source_group(Source\ Files\\video FILES ${LIBOS2D24_VIDEO_SOURCE_FILES}) source_group(Source\ Files\\gsmcodec FILES ${GSMCODEC_SOURCE_FILES}) # Add definition for P4 optimizations, warnings removal. add_definitions(-DOPTI_P4 -D_CRT_SECURE_NO_WARNINGS -DPNG_STATIC) if(SCOL_USE_QT) add_definitions(-DSCOL_QT) elseif(SCOL_USE_SDL) add_definitions(-DSCOL_SDL) endif() set(LIB2DOS_LIBRARIES ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${ZLIB_LIBRARY} ) # setup Scol lib2d os target add_library(libos2d24 ${Scol_LIB_TYPE} ${LIBOS2D24_HEADER_FILES} ${LIBOS2D24_SOURCE_FILES} ${LIBOS2D24_LOAD_HEADER_FILES} ${LIBOS2D24_OBJECTS_HEADER_FILES} ${LIBOS2D24_OBJECTS_SOURCE_FILES} ${LIBOS2D24_SOUNDS_HEADER_FILES} ${LIBOS2D24_SOUNDS_SOURCE_FILES} ${LIBOS2D24_VIDEO_HEADER_FILES} ${LIBOS2D24_VIDEO_SOURCE_FILES} ${GSMCODEC_HEADER_FILES} ${GSMCODEC_SOURCE_FILES} ) add_dependencies(libos2d24 kernel) # set the dll version. #set_target_properties(libos2d24 PROPERTIES VERSION ${Scol_VERSION} SOVERSION ${Scol_VERSION_MAJOR}) if (SCOL_USE_QT) if(APPLE) if (NOT Qt5Widgets_FOUND) #find_host_package(Qt5 COMPONENTS Widgets REQUIRED) set(QtModule "Widgets") find_host_package(Qt5 REQUIRED) endif() set(LIB2DOS_LIBRARIES ${LIB2DOS_LIBRARIES} Qt5::Widgets ${Qt5Widgets_STATIC_DEPS}) else() if (NOT Qt5Widgets_FOUND) find_package(Qt5 COMPONENTS Core Widgets) endif() set(LIB2DOS_LIBRARIES ${LIB2DOS_LIBRARIES} Qt5::Widgets Qt5::Gui Qt5::GuiPrivate) endif() set_target_properties(libos2d24 PROPERTIES AUTOMOC ON) elseif(SCOL_USE_SDL) if (NOT SDL2_FOUND) find_host_package(SDL2 REQUIRED) endif() set(LIB2DOS_LIBRARIES ${LIB2DOS_LIBRARIES} ${SDL2_LIBRARIES}) include_directories(${SDL2_INCLUDE_DIRS}) endif() # Add directories includes if (APPLE) include_directories(include gsmcodec ${PNG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS}) else() include_directories(include gsmcodec ${PNG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) endif() if (WIN32) set(LIB2DOS_LIBRARIES ${LIB2DOS_LIBRARIES} comctl32.lib vfw32.lib winmm.lib) elseif (ANDROID) set(LIB2DOS_LIBRARIES ${LIB2DOS_LIBRARIES} ndk_helper log android cpufeatures native_app_glue) set(Scol_ANDROID_DEPENDENCIES ${Scol_ANDROID_DEPENDENCIES} libos2d24 CACHE INTERNAL "" FORCE) message(STATUS "[${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}] Scol_ANDROID_DEPENDENCIES: ${Scol_ANDROID_DEPENDENCIES} -- added libos2d24 to android project deps") endif() target_link_libraries(libos2d24 ${LIB2DOS_LIBRARIES}) # install Scol libos2d24 scol_config_plugin(libos2d24) #install(FILES ${LIBOS2D24_HEADER_FILES} DESTINATION include/SCOL/plugins/lib2d_os_24) #install(FILES ${LIBOS2D24_LOAD_HEADER_FILES} DESTINATION include/SCOL/plugins/lib2d_os_24/load) #install(FILES ${LIBOS2D24_OBJECTS_HEADER_FILES} DESTINATION include/SCOL/plugins/lib2d_os_24/objects) #install(FILES ${LIBOS2D24_SOUNDS_HEADER_FILES} DESTINATION include/SCOL/plugins/lib2d_os_24/sound) #install(FILES ${LIBOS2D24_VIDEO_HEADER_FILES} DESTINATION include/SCOL/plugins/lib2d_os_24/video) #install(FILES ${GSMCODEC_HEADER_FILES} DESTINATION include/SCOL/plugins/lib2d_os_24/gsmcodec)