diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b841a462d078377543004a01869e45f9ed1af25..db32a9fc47a41a9b916baa6fea767551b46e610d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,8 +59,8 @@ message(STATUS "${BoldRed}CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}${ColourReset}") if(MXE) # Run the following cmake command line: # x86_64-w64-mingw32.shared-cmake -DCMAKE_BUILD_TYPE=Release -DMXE=1 ../development - include(${CMAKE_TOOLCHAINS_PATH}/mxe-toolchain.cmake) - #include(${CMAKE_TOOLCHAINS_PATH}/mxe-toolchain-olivier.cmake) + #include(${CMAKE_TOOLCHAINS_PATH}/mxe-toolchain.cmake) + include(${CMAKE_TOOLCHAINS_PATH}/mxe-toolchain-olivier.cmake) # Set the name to the systemUname variable because in this situation that name # is not found, it it passed as a flag in the command line. @@ -91,6 +91,17 @@ message("") message(STATUS "${BoldYellow}The build toolchain is: ${SystemUname}${ColourReset}") message("") + + +# BOOST +if(NOT Boost_FOUND) + message(STATUS "Boost not yet found. Searching for it.") + find_package(Boost COMPONENTS iostreams thread filesystem REQUIRED ) +endif() +message(STATUS "Boost_LIBRARIES found ${Boost_LIB_VERSION}") +message(STATUS "Boost_INCLUDES: ${Boost_INCLUDE_DIRS}") +message(STATUS "Boost_LIB_DIRS: ${Boost_LIBRARY_DIRS}") + #depending on libpappsomspp version : set(LIBPAPPSOMSPP_VERSION "0.7.7-2") configure_file (${CMAKE_SOURCE_DIR}/debian/control.cmake ${CMAKE_SOURCE_DIR}/debian/control @ONLY) @@ -115,20 +126,21 @@ endif(CMAKE_INSTALL_PREFIX) # Subdirectories add_subdirectory(src) -# Doxygen -find_package(Doxygen) -if(DOXYGEN_FOUND) - add_custom_target(apidoc cp Doxyfile ${CMAKE_BINARY_DIR}/Doxyfile-build - COMMAND echo "OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}" >> ${CMAKE_BINARY_DIR}/Doxyfile-build - COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile-build - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - add_custom_target(apidoc-stable cp Doxyfile ${CMAKE_BINARY_DIR}/Doxyfile-stable - COMMAND echo "OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}" >> ${CMAKE_BINARY_DIR}/Doxyfile-stable - COMMAND echo "HTML_HEADER=header.html" >> ${CMAKE_BINARY_DIR}/Doxyfile-stable - COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile-stable - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) -endif(DOXYGEN_FOUND) - +if(UNIX) + # Doxygen + find_package(Doxygen) + if(DOXYGEN_FOUND) + add_custom_target(apidoc cp Doxyfile ${CMAKE_BINARY_DIR}/Doxyfile-build + COMMAND echo "OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}" >> ${CMAKE_BINARY_DIR}/Doxyfile-build + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile-build + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + add_custom_target(apidoc-stable cp Doxyfile ${CMAKE_BINARY_DIR}/Doxyfile-stable + COMMAND echo "OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}" >> ${CMAKE_BINARY_DIR}/Doxyfile-stable + COMMAND echo "HTML_HEADER=header.html" >> ${CMAKE_BINARY_DIR}/Doxyfile-stable + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile-stable + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + endif(DOXYGEN_FOUND) +endif(UNIX) # Packager set(CPACK_PACKAGE_NAME "xtpcpp") set(CPACK_PACKAGE_VENDOR "PAPPSO Development Team") diff --git a/CMakeStuff/toolchains/mxe-toolchain-olivier.cmake b/CMakeStuff/toolchains/mxe-toolchain-olivier.cmake index cde2e2619a51583339bd1821b4a5e5a4d4a31f4d..bbfba899a7c43499758fc245cfd9ebe41db27819 100644 --- a/CMakeStuff/toolchains/mxe-toolchain-olivier.cmake +++ b/CMakeStuff/toolchains/mxe-toolchain-olivier.cmake @@ -1,78 +1,125 @@ +# File:///home/langella/developpement/git/pappsomspp/CMakeStuff/toolchains/mxe-toolchain.cmake# # This file should be included if the command line reads like this: # x86_64-w64-mingw32.shared-cmake -DCMAKE_BUILD_TYPE=Release -DMXE=1 .. -MESSAGE("MXE (M cross environment) https://mxe.cc/") +message("MXE (M cross environment) https://mxe.cc/") message("Please run the configuration like this:") -message("x86_64-w64-mingw32.shared-cmake -DMXE=1 -G \"Unix Makefiles\" -DCMAKE_BUILD_TYPE=Release ../../development") +message("x86_64-w64-mingw32.shared-cmake -DMXE= 1 -G \"Unix Makefiles\" -DCMAKE_BUILD_TYPE=Release ../../development") -set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES /media/langella/pappso/mxe/usr/x86_64-w64-mingw32.shared/include) -set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES /media/langella/pappso/mxe/usr/x86_64-w64-mingw32.shared/include) + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES /win64/mxe/usr/x86_64-w64-mingw32.shared/include) +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES /win64/mxe/usr/x86_64-w64-mingw32.shared/include) if(WIN32 OR _WIN32) message(STATUS "Building with WIN32 defined.") endif() +message(STATUS "${BoldGreen}Setting definition -DPMSPP_LIBRARY for symbol DLL export.${ColourReset}") +add_definitions(-DPMSPP_LIBRARY) + + +find_package(ZLIB REQUIRED) + +find_package(SQLite3 REQUIRED) + + +#install MXE qtsvg package +#langella@piccolo:/media/langella/pappso/mxe$ make qtsvg + + + +set(QCustomPlot_FOUND 1) +set(QCustomPlot_INCLUDE_DIR "/win64/qcustomplot-2.0.1+dfsg1") +set(QCustomPlot_LIBRARIES "/win64/qcustomplot-2.0.1+dfsg1/build/libqcustomplot.dll") +if(NOT TARGET QCustomPlot::QCustomPlot) + add_library(QCustomPlot::QCustomPlot UNKNOWN IMPORTED) + set_target_properties(QCustomPlot::QCustomPlot PROPERTIES + IMPORTED_LOCATION "${QCustomPlot_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${QCustomPlot_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS QCUSTOMPLOT_USE_LIBRARY) +endif() + -set (QCustomPlot_FOUND TRUE) -set (QCustomPlot_INCLUDES "/home/langella/developpement/git/qcustomplot") -set (QCustomPlot_LIBRARIES "/home/langella/developpement/git/qcustomplot/wbuild/libqcustomplot.dll") +set(Quazip5_FOUND 1) +set(Quazip5_INCLUDE_DIRS "/win64/libquazip-0.7.6") +set(Quazip5_LIBRARY "/win64/libquazip-0.7.6/build/libquazip5.dll") +if(NOT TARGET Quazip5::Quazip5) + add_library(Quazip5::Quazip5 UNKNOWN IMPORTED) + set_target_properties(Quazip5::Quazip5 PROPERTIES + IMPORTED_LOCATION "${Quazip5_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${Quazip5_INCLUDE_DIRS}") +endif() -#sudo apt install libc6-dev-i386 - # QUAZIP_INCLUDE_DIR - Path to QuaZip include dir -set (QUAZIP_INCLUDE_DIR "/home/langella/developpement/git/quazip") -# QUAZIP_INCLUDE_DIRS- Path to QuaZip and zlib include dir (combined from QUAZIP_INCLUDE_DIR + ZLIB_INCLUDE_DIR) -# QUAZIP_LIBRARIES - List of QuaZip libraries -set (QUAZIP_QT5_LIBRARIES "/home/langella/developpement/git/quazip/wbuild/libquazip5.dll") -set (QUAZIP_LIBRARIES "/home/langella/developpement/git/quazip/wbuild/libquazip5.dll") -# QUAZIP_ZLIB_INCLUDE_DIR- The include dir of zlib headers -set(ODSSTREAM_QT5_FOUND 1) -set(ODSSTREAM_INCLUDE_DIR "/home/langella/developpement/git/libodsstream/src") -set(ODSSTREAM_QT5_LIBRARY "/home/langella/developpement/git/libodsstream/wbuild/src/libodsstream-qt5.dll") +set(OdsStream_FOUND 1) +set(OdsStream_INCLUDE_DIRS "/home/olivier/eclipse/git/libodsstream/src") +set(OdsStream_LIBRARY "/home/olivier/eclipse/git/libodsstream/wbuild/src/libodsstream.dll") if(NOT TARGET OdsStream::Core) add_library(OdsStream::Core UNKNOWN IMPORTED) - set_target_properties(OdsStream::Core PROPERTIES - IMPORTED_LOCATION "${ODSSTREAM_QT5_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${ODSSTREAM_INCLUDE_DIR}" + set_target_properties(OdsStream::Core PROPERTIES + IMPORTED_LOCATION "${OdsStream_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${OdsStream_INCLUDE_DIRS}" ) endif() -set(PAPPSOMSPP_QT5_FOUND 1) -set(PAPPSOMSPP_WIDGET_QT5_FOUND 1) -set(PAPPSOMSPP_INCLUDE_DIR "/home/langella/developpement/git/pappsomspp/src") -mark_as_advanced(PAPPSOMSPP_INCLUDE_DIR) -set(PAPPSOMSPP_QT5_LIBRARY "/home/langella/developpement/git/pappsomspp/wbuild/src/libpappsomspp-qt5.dll") -mark_as_advanced(PAPPSOMSPP_QT5_LIBRARY) -set(PAPPSOMSPP_WIDGET_QT5_LIBRARY "/home/langella/developpement/git/pappsomspp/wbuild/src/pappsomspp/widget/libpappsomspp-widget-qt5.dll") -mark_as_advanced(PAPPSOMSPP_WIDGET_QT5_LIBRARY) - -if(NOT TARGET Pappso::Core) - add_library(Pappso::Core UNKNOWN IMPORTED) - set_target_properties(Pappso::Core PROPERTIES - IMPORTED_LOCATION "${PAPPSOMSPP_QT5_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${PAPPSOMSPP_INCLUDE_DIR}") +set(Alglib_FOUND 1) +set(Alglib_INCLUDE_DIR "/win64/alglib-3.16.0/src") +set(Alglib_LIBRARY "/win64/alglib-3.16.0/build/libalglib.dll") +if(NOT TARGET Alglib::Alglib) + add_library(Alglib::Alglib UNKNOWN IMPORTED) + set_target_properties(Alglib::Alglib PROPERTIES + IMPORTED_LOCATION "${Alglib_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${Alglib_INCLUDE_DIR}") endif() -if(NOT TARGET Pappso::Widget) - add_library(Pappso::Widget UNKNOWN IMPORTED) - set_target_properties(Pappso::Widget PROPERTIES - IMPORTED_LOCATION "${PAPPSOMSPP_WIDGET_QT5_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${PAPPSOMSPP_INCLUDE_DIR}") -endif() - +# All this belly dance does not seem necessary. Just perform like for the other +# libraries... +# Look for the necessary header +set(Zstd_INCLUDE_DIR /win64/mxe/usr/x86_64-w64-mingw32.shared/include) +mark_as_advanced(Zstd_INCLUDE_DIR) +set(Zstd_INCLUDE_DIRS ${Zstd_INCLUDE_DIR}) +# Look for the necessary library +set(Zstd_LIBRARY /win64/mxe/usr/x86_64-w64-mingw32.shared/bin/libzstd.dll) +mark_as_advanced(Zstd_LIBRARY) +# Mark the lib as found +set(Zstd_FOUND 1) +set(Zstd_LIBRARIES ${Zstd_LIBRARY}) +if(NOT TARGET Zstd::Zstd) + add_library(Zstd::Zstd UNKNOWN IMPORTED) + set_target_properties(Zstd::Zstd PROPERTIES + IMPORTED_LOCATION "${Zstd_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${Zstd_INCLUDE_DIR}") +endif() -set(Pwiz_FOUND 1) -set(Pwiz_INCLUDE_DIR "/home/langella/developpement/git/custompwiz/src") -set(Pwiz_LIBRARY "/home/langella/developpement/git/custompwiz/wbuild/src/libcustompwiz.dll") -if(NOT TARGET Pwiz::Pwiz) - add_library(Pwiz::Pwiz UNKNOWN IMPORTED) - set_target_properties(Pwiz::Pwiz PROPERTIES - IMPORTED_LOCATION "${Pwiz_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${Pwiz_INCLUDE_DIR}") +set(PappsoMSpp_INCLUDE_DIR /home/olivier/eclipse/git/pappsomspp/src/) +mark_as_advanced(PappsoMSpp_INCLUDE_DIR) +set(PappsoMSpp_INCLUDE_DIRS ${PappsoMSpp_INCLUDE_DIR}) +# Look for the necessary library +set(PappsoMSpp_LIBRARY /home/olivier/eclipse/git/pappsomspp/wbuild/src/libpappsomspp.dll) +mark_as_advanced(PappsoMSpp_LIBRARY) +# Mark the lib as found +set(PappsoMSpp_FOUND 1) +set(PappsoMSpp_LIBRARIES ${PappsoMSpp_LIBRARY}) +if(NOT TARGET PappsoMSpp::Core) + add_library(PappsoMSpp::Core UNKNOWN IMPORTED) + set_target_properties(PappsoMSpp::Core PROPERTIES + IMPORTED_LOCATION "${PappsoMSpp_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${PappsoMSpp_INCLUDE_DIRS}") endif() +set(PappsoMSppWidget_LIBRARY /home/olivier/eclipse/git/pappsomspp/wbuild/src/pappsomspp/widget/libpappsomspp-widget.dll) +mark_as_advanced(PappsoMSppWidget_LIBRARY) +message(STATUS "~~~~~~~~~~~~~ ${PappsoMSppWidget_LIBRARY} ~~~~~~~~~~~~~~~") +set(PappsoMSppWidget_FOUND TRUE) +if(NOT TARGET PappsoMSpp::Widget) + add_library(PappsoMSpp::Widget UNKNOWN IMPORTED) + set_target_properties(PappsoMSpp::Widget PROPERTIES + IMPORTED_LOCATION "${PappsoMSppWidget_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${PappsoMSpp_INCLUDE_DIRS}") +endif() + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 746363771d9309842293f3d902700bcf30cbb312..24702b5a0c9c87713158a5a856ee81442e07c4d6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,7 +12,7 @@ SET(xtpcpp_RCCS xtpcpp.qrc) find_package( Qt5 COMPONENTS Core Gui Svg Xml PrintSupport Sql Network Concurrent REQUIRED ) -QT5_ADD_RESOURCES(xtpcpp_RCC_SRCS ${xtpcpp_RCCS}) +qt5_add_resources(xtpcpp_RCC_SRCS ${xtpcpp_RCCS}) if(QCustomPlot_FOUND) MESSAGE("QCustomPlot_INCLUDES found ${QCustomPlot_INCLUDES}") @@ -33,7 +33,7 @@ if(PappsoMSppWidget_FOUND) else(PappsoMSppWidget_FOUND) message("PAPPSOms++ widget library not found") message("did you apt-get install libpappsomspp-widget-dev ?") -endif(PappsoMSpp_WIDGET_FOUND) +endif(PappsoMSppWidget_FOUND) message("PAPPSOms++ library : ${PappsoMSpp_LIBRARY}") @@ -213,7 +213,7 @@ set(GUI_UIS # this will run uic on .ui files: -QT5_WRAP_UI( GUI_UI_HDRS ${GUI_UIS} ) +qt5_wrap_ui( GUI_UI_HDRS ${GUI_UIS} ) message("XTPCPP_SRCS: ${XTPCPP_SRCS}") @@ -222,68 +222,38 @@ message("XTPCPP_SRCS: ${XTPCPP_SRCS}") add_executable(xtpcpp main.cpp ${CPP_FILES} ${XTPCPP_SRCS} ${GUI_UI_HDRS} ${xtpcpp_RCC_SRCS}) target_include_directories(xtpcpp PUBLIC - ${QCustomPlot_INCLUDES} - ${QUAZIP_INCLUDE_DIR} + ${Quazip5_INCLUDE_DIRS} + ${QCustomPlot_INCLUDE_DIR} ) -target_compile_definitions(xtpcpp PUBLIC ${QT_DEFINITIONS}) - set_target_properties(xtpcpp - PROPERTIES OUTPUT_NAME xtpcpp - CLEAN_DIRECT_OUTPUT 1 - #COMPILE_DEFINITIONS "${QT_DEFINITIONS}" - #INCLUDE_DIRECTORIES "${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}" - ) - -if(MINGW) +if(MXE) target_compile_options( xtpcpp PRIVATE -mwindows ) set_target_properties(xtpcpp PROPERTIES LINK_FLAGS "-Wl,--subsystem,windows ${CMAKE_EXE_LINKER_FLAGS}") - - - target_link_libraries(xtpcpp - OdsStream::Core - PappsoMSpp::Core - PappsoMSpp::Widget - ${QCustomPlot_LIBRARIES} - ${ZLIB_LIBRARIES} - Qt5::Gui - Qt5::Xml - Qt5::Svg - Qt5::PrintSupport - Qt5::Network - Qt5::Sql - Qt5::Concurrent - Boost::thread - Boost::filesystem - Boost::iostreams - ZLIB::ZLIB - Alglib::Alglib - Zstd::Zstd - ) -else(MINGW) - target_link_libraries(xtpcpp - ${Pwiz_LIBRARY} - OdsStream::Core - PappsoMSpp::Core - PappsoMSpp::Widget - ${QCustomPlot_LIBRARIES} - Qt5::Core - Qt5::Gui - Qt5::Xml - Qt5::Svg - Qt5::PrintSupport - Qt5::Network - Qt5::Sql - Qt5::Concurrent - Boost::thread - Boost::filesystem - Boost::iostreams - ZLIB::ZLIB - Alglib::Alglib - Zstd::Zstd - ) -endif(MINGW) +endif(MXE) + +target_link_libraries(xtpcpp + OdsStream::Core + PappsoMSpp::Core + PappsoMSpp::Widget + Qt5::Core + Qt5::Gui + Qt5::Xml + Qt5::Svg + Qt5::PrintSupport + Qt5::Network + Qt5::Sql + Qt5::Concurrent + Boost::thread + Boost::filesystem + Boost::iostreams + ZLIB::ZLIB + Alglib::Alglib + Zstd::Zstd + ${QCustomPlot_LIBRARIES} + ${Quazip5_LIBRARY} +)