* [Building and executing test cases](#building-and-executing-test-cases)
* [2. GBS Builds](#2-gbs-builds)
* [DEBUG Builds](#debug-builds)
+ * [3. Building for MS Windows](#3-building-for-ms-windows)
+ * Build with the Visual Studio project.
+ * Build with CMake.
# Build Instructions
## 1. Building for Ubuntu desktop
-### Requirements
+### Minimum Requirements
- Ubuntu 14.04 or later
- Environment created using dali_env script in dali-core repository
### DEBUG Builds
$ gbs build -A [TARGET_ARCH] --define "%enable_debug 1"
+
+
+## 3. Building for MS Windows
+
+Third party dependencies are built using vcpkg. Instructions on how to install vcpkg can be found in the
+vcpkg-script folder in the windows-dependencies repository.
+
+- Download the windows-dependencies repository from DaliHub
+
+ $ git clone https://github.com/dalihub/windows-dependencies.git
+
+- Read the windows-dependencies/vcpkg-script/Readme.md file for more instructions on how to build and install the third-party dependencies.
+
+### Build with the Visual Studio project
+ Read the windows-dependencies/README.md file for more instructions on how to build and run DALi for MS Windows.
+
+### Build with CMake
+
+ * Requirements
+ It's required the version 3.12.2 of CMake and a Git Bash Shell.
+
+ * Notes and troubleshoting:
+ It should be possible to use the MS Visual studio Developer Command Prompt (https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs) to build DALi from the command line.
+ However, the CMake version installed with MS Visual Studio 2017 is a bit out of date and some VCPKG modules require a higher version.
+ This instructions have been tested with CMake 3.12.2 on a Git Bash shell.
+
+ * Define an environment variable to set the path to the VCPKG folder
+
+ $ export VCPKG_FOLDER=C:/Users/username/Workspace/VCPKG_TOOL
+
+ * Define an environment variable to set the path where DALi is going to be installed.
+
+ $ export DALI_ENV_FOLDER=C:/Users/username/Workspace/dali-env
+
+ * Execute the following commands to create the makefiles, build and install DALi.
+
+ $ cmake -g Ninja . -DCMAKE_TOOLCHAIN_FILE=$VCPKG_FOLDER/vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_PKG_CONFIGURE=OFF -DENABLE_LINK_TEST=OFF -DCMAKE_INSTALL_PREFIX=$DALI_ENV_FOLDER -DINSTALL_CMAKE_MODULES=ON -DPROFILE_LCASE=windows
+ $ cmake --build . --target install
+
+ * Options:
+ - CMAKE_TOOLCHAIN_FILE ---> Needed to find packages installed by VCPKG.
+ - ENABLE_PKG_CONFIGURE ---> Whether to install pkg configure files (not currently working on MS Windows. CMake modules used instead).
+ - ENABLE_LINK_TEST ---> Whether to enable the link test (not currently working on MS Windows).
+ - CMAKE_INSTALL_PREFIX ---> Were DALi is installed.
+ - INSTALL_CMAKE_MODULES ---> Whether to install the CMake modules (Used by the CMake command find_package() to find previously installed libraries).
+ - PROFILE_LCASE ---> The platform (must be windows).
+ - ENABLE_DEBUG ---> Whether to build with debug enabled.
IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
FIND_PACKAGE( dali-windows-dependencies REQUIRED)
FIND_PACKAGE( dali-core REQUIRED)
- FIND_PATH( SYSTEM_INCLUDE_DIR "dali-windows-dependencies.h" )
ENDIF()
+SET( VCPKG_INCLUDE_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
+
IF( UNIX )
ADD_DEFINITIONS(-DPLATFORM_TIZEN)
ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS)
ENDIF()
# Set up the lib dir
-IF( SET_VCPKG_INSTALL_PREFIX )
+SET( LIB_DIR $ENV{libdir} )
+IF( NOT LIB_DIR )
+ SET( LIB_DIR ${CMAKE_INSTALL_LIBDIR} )
+ENDIF()
+IF( NOT LIB_DIR )
SET( LIB_DIR ${PREFIX}/lib )
+ENDIF()
+
+# Set up the bin dir
+SET( BIN_DIR $ENV{bindir} )
+IF( NOT BIN_DIR )
+ SET( BIN_DIR ${CMAKE_INSTALL_BINDIR} )
+ENDIF()
+IF( NOT BIN_DIR )
SET( BIN_DIR ${PREFIX}/bin )
-ELSE()
- SET( LIB_DIR $ENV{libdir} )
- IF( NOT LIB_DIR )
- SET( LIB_DIR ${CMAKE_INSTALL_LIBDIR} )
- ENDIF()
- IF( NOT LIB_DIR )
- SET( LIB_DIR ${PREFIX}/lib )
- ENDIF()
ENDIF()
IF( UNIX )
ADD_COMPILE_OPTIONS( /FIextern-definitions.h ) # Adds missing definitions.
ADD_COMPILE_OPTIONS( /FIpreprocessor-definitions.h ) #
ADD_COMPILE_OPTIONS( /vmg ) # Avoids a 'reinterpret_cast' compile error while compiling signals and callbacks.
- ADD_COMPILE_OPTIONS( /TP ) # All files considered C++
+ ADD_COMPILE_OPTIONS( /wd4251 ) # Ignores warning C4251: "'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'"
ENDIF()
ADD_DEFINITIONS( -DNON_POWER_OF_TWO_TEXTURES
${ROOT_SRC_DIR}
${PROFILE_INCLUDE_DIRECTORIES}
${THIRD_PARTY_WINDOWS_PLATFORM}
- ${SYSTEM_INCLUDE_DIR}
+ ${VCPKG_INCLUDE_DIR}
+ ${INCLUDE_DIR}
)
SET(LIBTYPE SHARED)
CLEAN_DIRECT_OUPUT 1
)
-# Install the library so file and symlinks
IF( INSTALL_CMAKE_MODULES )
+ IF( ENABLE_DEBUG )
+ SET( BIN_DIR "${BIN_DIR}/debug" )
+ SET( LIB_DIR "${LIB_DIR}/debug" )
+ ENDIF()
+
+ # Install the library files.
INSTALL( TARGETS ${name}
EXPORT ${name}-targets
LIBRARY DESTINATION ${LIB_DIR}
RUNTIME DESTINATION ${BIN_DIR}
)
+ # Install the cmake modules.
INSTALL(
EXPORT ${name}-targets
NAMESPACE ${name}::
include(\${CMAKE_CURRENT_LIST_DIR}/${name}-targets.cmake)
")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}-config.cmake DESTINATION share/${name})
+
+ # Install the pdb file.
+ IF( ENABLE_DEBUG )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/${name}.pdb DESTINATION ${BIN_DIR} )
+ ENDIF()
ELSE()
+ # Install the library so file and symlinks
INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} )
ENDIF()
MESSAGE( STATUS "Enable link test: ${ENABLE_LINK_TEST}" )
MESSAGE( STATUS "Tizen Platform Config supported ${TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG}")
MESSAGE( STATUS "Compile flags: ${CMAKE_CXX_FLAGS}")
+MESSAGE( STATUS "Compile flags: ${CMAKE_C_FLAGS}")
IF( enable_feedback )
ADD_SUBDIRECTORY( plugins )
ENDIF()
${adaptor_imaging_windows_src_files}
)
+# Builds the c files as c++
+SET_SOURCE_FILES_PROPERTIES( ${static_libraries_libunibreak_src_files} PROPERTIES LANGUAGE CXX )
+
FIND_PACKAGE( pthreads REQUIRED )
FIND_PACKAGE( curl REQUIRED )
FIND_LIBRARY( GETOPT_LIBRARY NAMES getopt )
FIND_PACKAGE( jpeg REQUIRED )
FIND_LIBRARY( TURBO_JPEG_LIBRARY NAMES turbojpeg )
-FIND_PACKAGE( fontconfig REQUIRED )
+FIND_PACKAGE( unofficial-fontconfig REQUIRED )
FIND_PACKAGE( freetype REQUIRED )
FIND_PACKAGE( harfbuzz REQUIRED )
FIND_LIBRARY( FRIBIDI_LIBRARY NAMES fribidi )
${GIF_LIBRARIES}
JPEG::JPEG
${TURBO_JPEG_LIBRARY}
- ${FONTCONFIG_LIBRARIES}
+ unofficial::fontconfig::fontconfig
Freetype::Freetype
harfbuzz::harfbuzz
${FRIBIDI_LIBRARY}