diff --git a/.github/workflows/linux-BUILD_DEPS.yml b/.github/workflows/linux-BUILD_DEPS.yml index ee00493e82..4a3ec921dd 100644 --- a/.github/workflows/linux-BUILD_DEPS.yml +++ b/.github/workflows/linux-BUILD_DEPS.yml @@ -4,9 +4,7 @@ on: push: branches: - develop - - fix/unit-tests-not-found-on-github-actions - - release/v7.2-rc1 - + - feature/* jobs: linux: diff --git a/.github/workflows/linux-system.yml b/.github/workflows/linux-system.yml index 95b64b3d89..4c19bac14f 100644 --- a/.github/workflows/linux-system.yml +++ b/.github/workflows/linux-system.yml @@ -4,9 +4,7 @@ on: push: branches: - develop - - fix/unit-tests-not-found-on-github-actions - - release/v7.2-rc1 - + - feature/* jobs: build: diff --git a/.github/workflows/windows-BUILD_DEPS.yml b/.github/workflows/windows-BUILD_DEPS.yml index 8368054639..849ae872ae 100644 --- a/.github/workflows/windows-BUILD_DEPS.yml +++ b/.github/workflows/windows-BUILD_DEPS.yml @@ -4,9 +4,7 @@ on: push: branches: - develop - - fix/unit-tests-not-found-on-github-actions - - release/v7.2-rc1 - + - feature/* jobs: windows: diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index e28f982bc4..d3de6256ac 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -4,9 +4,7 @@ on: push: branches: - develop - - fix/unit-tests-not-found-on-github-actions - - release/v7.2-rc1 - + - feature/* jobs: windows: diff --git a/.gitignore b/.gitignore index 9741dd9a65..5051416b36 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,6 @@ Release *.layout src/.vs -resources/examples* resources/antares-open* bin/debug bin/release diff --git a/.gitmodules b/.gitmodules index e69de29bb2..d2bec31124 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "resources/examples"] + path = resources/examples + url = https://github.com/AntaresSimulatorTeam/Antares_Simulator_Examples.git diff --git a/docs/ref_guides/Antares-examples-library.pdf b/docs/ref_guides/antares-examples-library.pdf similarity index 100% rename from docs/ref_guides/Antares-examples-library.pdf rename to docs/ref_guides/antares-examples-library.pdf diff --git a/docs/ref_guides/Antares-general-reference-guide.docx b/docs/ref_guides/antares-general-reference-guide.docx similarity index 100% rename from docs/ref_guides/Antares-general-reference-guide.docx rename to docs/ref_guides/antares-general-reference-guide.docx diff --git a/docs/ref_guides/Antares-general-reference-guide.pdf b/docs/ref_guides/antares-general-reference-guide.pdf similarity index 100% rename from docs/ref_guides/Antares-general-reference-guide.pdf rename to docs/ref_guides/antares-general-reference-guide.pdf diff --git a/docs/ref_guides/Antares-Optimization-Problems-Formulation.docx b/docs/ref_guides/optimization-problems-formulation.docx similarity index 100% rename from docs/ref_guides/Antares-Optimization-Problems-Formulation.docx rename to docs/ref_guides/optimization-problems-formulation.docx diff --git a/docs/ref_guides/Antares-Optimization-Problems-Formulation.pdf b/docs/ref_guides/optimization-problems-formulation.pdf similarity index 100% rename from docs/ref_guides/Antares-Optimization-Problems-Formulation.pdf rename to docs/ref_guides/optimization-problems-formulation.pdf diff --git a/docs/ref_guides/Antares-map-editor-reference-guide.pdf b/docs/ref_guides/system-map-editor-reference-guide.pdf similarity index 100% rename from docs/ref_guides/Antares-map-editor-reference-guide.pdf rename to docs/ref_guides/system-map-editor-reference-guide.pdf diff --git a/resources/examples b/resources/examples new file mode 160000 index 0000000000..2efa081163 --- /dev/null +++ b/resources/examples @@ -0,0 +1 @@ +Subproject commit 2efa081163500b37dcd9f0a6bd7a2f25bf3bded3 diff --git a/resources/examples.7z b/resources/examples.7z deleted file mode 100644 index 591fb23147..0000000000 Binary files a/resources/examples.7z and /dev/null differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ca7aadcce7..087ed7b5de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -168,13 +168,14 @@ CMAKE_DEPENDENT_OPTION(BUILD_zlib "Build zlib dependency Library" OFF message(STATUS "Build BUILD_zlib: ${BUILD_zlib}") # Build Needed dependencies -add_subdirectory(cmake/dependencies dependencies) -list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}/dependencies/install) -list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}/dependencies/install/libs/pkgconfig) +list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build_deps/install) +list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build_deps/install/libs/pkgconfig) + +add_subdirectory(cmake/dependencies ${CMAKE_CURRENT_SOURCE_DIR}/build_deps) if(BUILD_wxWidgets) # Define wxWidgets_ROOT_DIR - set(wxWidgets_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/dependencies/install) + set(wxWidgets_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build_deps/install) endif() # Define needed external library @@ -315,16 +316,38 @@ if(WIN32 OR WIN64) SET(ANTARES_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}) + # Define system libraries so NSIS can package these files + include (InstallRequiredSystemLibraries) + + #Convert to native and add double quote to be used in NSIS package + foreach(SYSTEM_RUNTIME_LIB ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}) + file(TO_NATIVE_PATH ${SYSTEM_RUNTIME_LIB} SYSTEM_RUNTIME_LIB_NATIVE) + + list(APPEND SYSTEM_RUNTIME_LIBS_NATIVE \"${SYSTEM_RUNTIME_LIB_NATIVE}\") + endforeach() + + #Replace ; by space so SYSTEM_RUNTIME_LIBS_STR can be used in File function in NSIS file + string (REPLACE ";" " " SYSTEM_RUNTIME_LIBS_STR "${SYSTEM_RUNTIME_LIBS_NATIVE}") + configure_file( ${PROJECT_SOURCE_DIR}/distrib/win32/NSIS.template.in ${CMAKE_CURRENT_BINARY_DIR}/distrib/win32/NSIS.template.in @ONLY ) + #Define cpack install script to checkout examples + configure_file( + ${PROJECT_SOURCE_DIR}/distrib/CMakeLists.txt.in + ${CMAKE_CURRENT_BINARY_DIR}/distrib/CMakeLists.txt + @ONLY + ) + + set(CPACK_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/distrib/CMakeLists.txt) + #Set package name from CMake and antares variables set(CPACK_PACKAGE_FILE_NAME "rte-antares-${ANTARES_VERSION_HI}.${ANTARES_VERSION_LO}.${ANTARES_VERSION_REVISION}${ANTARES_VERSION_TAG}-installer-${ANTARES_INSTALLER_ARCH}") - #Load packaging facilities. - include(CPack) + + else() #For now only test deb, need to define several CPACK variable @@ -339,7 +362,9 @@ else() configure_file("distrib/unix/packages.cmake" "distrib/unix/packages.sh") - # Load packaging facilities. - include(CPack) + endif() +# Load packaging facilities. +include(CPack) + diff --git a/src/cmake/dependencies/CMakeLists.txt b/src/cmake/dependencies/CMakeLists.txt index 409bd17761..f2bd44a219 100644 --- a/src/cmake/dependencies/CMakeLists.txt +++ b/src/cmake/dependencies/CMakeLists.txt @@ -3,6 +3,11 @@ ############## if(BUILD_OPENSSL) +#Check if OpenSSL is not already available +find_package(OpenSSL) + +if (NOT OPENSSL_FOUND) + #TODO : get architecture for windows (can propably be done in a better way) if(WIN32 OR WIN64) if(ANTARES_x86_64) @@ -33,6 +38,9 @@ build_git_dependency( INSTALL_COMMAND "${MAKE_COMMAND} install_sw" ) + +endif() + endif() ############## @@ -40,6 +48,10 @@ endif() ############## if(BUILD_curl) +#Check if CURL is not already available +find_package(CURL) + +if (NOT CURL_FOUND) if(WIN32 OR WIN64) if(ANTARES_x86_64) @@ -91,6 +103,9 @@ if(WIN32 OR WIN64) #We need to rename libcurl_a.lib to libcurl.lib for find_package(CURL) file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/install/lib/libcurl_a.lib ${CMAKE_CURRENT_BINARY_DIR}/install/lib/libcurl.lib) endif() + + +endif() endif() @@ -98,6 +113,12 @@ endif() ## wxWidgets ## ############## if(BUILD_wxWidgets) + +#Check if wxWidgets is not already available +find_package(wxWidgets) + +if (NOT wxWidgets_FOUND) + build_git_dependency( NAME wxWidgets @@ -108,6 +129,9 @@ if(BUILD_wxWidgets) CMAKE_ARGS -DwxBUILD_SHARED=OFF ) + +endif() + endif() diff --git a/src/cmake/wxWidgets/FindwxWidgets.cmake b/src/cmake/wxWidgets/FindwxWidgets.cmake index 5ccdb1f0a3..dea003dce6 100644 --- a/src/cmake/wxWidgets/FindwxWidgets.cmake +++ b/src/cmake/wxWidgets/FindwxWidgets.cmake @@ -169,8 +169,8 @@ macro(DBG_MSG _MSG) "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") endmacro() macro(DBG_MSG_V _MSG) - message(STATUS - "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") +# message(STATUS +# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") endmacro() # Clear return values in case the module is loaded more than once. diff --git a/src/distrib/CMakeLists.txt.in b/src/distrib/CMakeLists.txt.in new file mode 100644 index 0000000000..33163d94ec --- /dev/null +++ b/src/distrib/CMakeLists.txt.in @@ -0,0 +1,26 @@ +find_package(Git QUIET) + +set(ANTARES_EXAMPLES_TAG "v7.2.0") + +message(STATUS "Submodule examples update with ${ANTARES_EXAMPLES_TAG} tag") + +# Update example submodules as needed + +execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init + WORKING_DIRECTORY @PROJECT_SOURCE_DIR@/../resources/ + RESULT_VARIABLE GIT_SUBMOD_RESULT) +if(NOT GIT_SUBMOD_RESULT EQUAL "0") + message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") +endif() + +# Define submodule tag + +execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ANTARES_EXAMPLES_TAG} + WORKING_DIRECTORY @PROJECT_SOURCE_DIR@/../resources/examples + RESULT_VARIABLE GIT_SUBMOD_RESULT) +if(NOT GIT_SUBMOD_RESULT EQUAL "0") + message(FATAL_ERROR "git checkout ${ANTARES_EXAMPLES_TAG} failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") +endif() + + + \ No newline at end of file diff --git a/src/distrib/win32/NSIS.template.in b/src/distrib/win32/NSIS.template.in index 853518e5bb..3f816bf40f 100644 --- a/src/distrib/win32/NSIS.template.in +++ b/src/distrib/win32/NSIS.template.in @@ -306,8 +306,8 @@ ${MementoSection} "$(LngCoreFiles)" SecCore ${File} "${ANTARES_BUILD_DIR}\tools\config\${TARGET}" "antares-${CMAKE_SIMPLE_VERSION}-config.exe" ${File} "${ANTARES_BUILD_DIR}\ui\simulator\resources\icons" "study.ico" - ;TODO : for now no redist in installer - ;${File} "@PROJECT_SOURCE_DIR@\distrib\win32\redist\${ANTARES_REDIST_ARCH}" "*.dll" + ;Add system runtime libs (defined in src/CMakeList.txt) + File @SYSTEM_RUNTIME_LIBS_STR@ ; !insertmacro AppendCoreFiles @@ -360,7 +360,7 @@ ${MementoSection} "$(LngResExamples)" SecExamples SectionIn 1 SetOverwrite on - #!include "examplesfiles.inc.nsh" + !include "@PROJECT_SOURCE_DIR@\distrib\win32\examplesfiles.inc.nsh" ${Mementosectionend} ${MementoSection} "$(LngResSources)" SecSources @@ -372,7 +372,7 @@ ${MementoSection} "$(LngResSources)" SecSources SectionIn 1 SetOverwrite on - #!include "sourcefiles.inc.nsh" + !include "@PROJECT_SOURCE_DIR@\distrib\win32\sourcefiles.inc.nsh" ${Mementosectionend} diff --git a/src/distrib/win32/examplesfiles.inc.nsh b/src/distrib/win32/examplesfiles.inc.nsh new file mode 100644 index 0000000000..fb2b46128c --- /dev/null +++ b/src/distrib/win32/examplesfiles.inc.nsh @@ -0,0 +1,4 @@ + +${SetOutPath} "$INSTDIR\Examples" + +File /r ${ANTARES_SRC_DIR}\..\resources\examples\*.* diff --git a/src/distrib/win32/sourcefiles.inc.nsh b/src/distrib/win32/sourcefiles.inc.nsh index 43d0499090..01c37b37cb 100644 --- a/src/distrib/win32/sourcefiles.inc.nsh +++ b/src/distrib/win32/sourcefiles.inc.nsh @@ -1,2 +1,30 @@ +${SetOutPath} "$INSTDIR\Sources\src" +File /nonfatal /r /x build_deps ${ANTARES_SRC_DIR}\..\src\*.* + ${SetOutPath} "$INSTDIR\Sources" -File /r ..\..\Antares_Simulator-only-sources\*.* \ No newline at end of file +File ${ANTARES_SRC_DIR}\..\AUTHORS.txt +File ${ANTARES_SRC_DIR}\..\CERTIFICATE.txt +File ${ANTARES_SRC_DIR}\..\CONTRIBUTING.txt +File ${ANTARES_SRC_DIR}\..\COPYING.txt +File ${ANTARES_SRC_DIR}\..\NEWS.txt +File ${ANTARES_SRC_DIR}\..\ROADMAP.txt +File ${ANTARES_SRC_DIR}\..\THANKS.txt +File ${ANTARES_SRC_DIR}\..\INSTALL.md +File ${ANTARES_SRC_DIR}\..\README.md + +${SetOutPath} "$INSTDIR\Sources\docs" +File /r ${ANTARES_SRC_DIR}\..\docs\*.* + +${SetOutPath} "$INSTDIR\Sources\resources" +File /r ${ANTARES_SRC_DIR}\..\resources\*.* + +; TODO For now build_deps source are not provided + +;${SetOutPath} "$INSTDIR\Sources\src\build_deps\curl\source" +;File /nonfatal /r /x builds .git ${ANTARES_SRC_DIR}\..\src\build_deps\curl\source\*.* + +;${SetOutPath} "$INSTDIR\Sources\src\build_deps\OpenSSL\source" +;File /nonfatal /r /x .git ${ANTARES_SRC_DIR}\..\src\build_deps\OpenSSL\source\*.* + +;${SetOutPath} "$INSTDIR\Sources\src\build_deps\wxWidgets\source" +;File /nonfatal /r /x .git ${ANTARES_SRC_DIR}\..\src\build_deps\wxWidgets\source\*.* \ No newline at end of file diff --git a/src/ext/libcurl b/src/ext/libcurl deleted file mode 160000 index 3c561c657c..0000000000 --- a/src/ext/libcurl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3c561c657c2f0e553b19115a506592a8bbd744bc diff --git a/src/ext/openssl b/src/ext/openssl deleted file mode 160000 index e216bf9d7c..0000000000 --- a/src/ext/openssl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e216bf9d7ca761718f34e8b3094fcb32c7a143e4 diff --git a/src/ext/wxwidgets b/src/ext/wxwidgets deleted file mode 160000 index 37aa8123b5..0000000000 --- a/src/ext/wxwidgets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 37aa8123b5fa79702a6c77a5fd3f05d811d688b6