Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/nsis installer update and new external lib build dir #28

Merged
merged 13 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/linux-BUILD_DEPS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
push:
branches:
- develop
- fix/unit-tests-not-found-on-github-actions
- release/v7.2-rc1

- feature/*
jobs:

linux:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/linux-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
push:
branches:
- develop
- fix/unit-tests-not-found-on-github-actions
- release/v7.2-rc1

- feature/*
jobs:
build:

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/windows-BUILD_DEPS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
push:
branches:
- develop
- fix/unit-tests-not-found-on-github-actions
- release/v7.2-rc1

- feature/*
jobs:

windows:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
push:
branches:
- develop
- fix/unit-tests-not-found-on-github-actions
- release/v7.2-rc1

- feature/*
jobs:

windows:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Release
*.layout
src/.vs

resources/examples*
resources/antares-open*
bin/debug
bin/release
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "resources/examples"]
path = resources/examples
url = https://github.com/AntaresSimulatorTeam/Antares_Simulator_Examples.git
1 change: 1 addition & 0 deletions resources/examples
Submodule examples added at 2efa08
Binary file removed resources/examples.7z
Binary file not shown.
41 changes: 33 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
guilpier-code marked this conversation as resolved.
Show resolved Hide resolved

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
Expand Down Expand Up @@ -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
Expand All @@ -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)

24 changes: 24 additions & 0 deletions src/cmake/dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
##############
if(BUILD_OPENSSL)
jmkerloch marked this conversation as resolved.
Show resolved Hide resolved

#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)
Expand Down Expand Up @@ -33,13 +38,20 @@ build_git_dependency(
INSTALL_COMMAND
"${MAKE_COMMAND} install_sw"
)

endif()

endif()

##############
## curl ##
##############
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)
Expand Down Expand Up @@ -91,13 +103,22 @@ 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()

##############
## wxWidgets ##
##############
if(BUILD_wxWidgets)

#Check if wxWidgets is not already available
find_package(wxWidgets)

if (NOT wxWidgets_FOUND)

build_git_dependency(
NAME
wxWidgets
Expand All @@ -108,6 +129,9 @@ if(BUILD_wxWidgets)
CMAKE_ARGS
-DwxBUILD_SHARED=OFF
)

endif()

endif()


4 changes: 2 additions & 2 deletions src/cmake/wxWidgets/FindwxWidgets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ macro(DBG_MSG _MSG)
"${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question : this file is processed by cmake only in case of vcpkg use. Why ? (I don't understand the comment in src/CMakeLists.txt : 227)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is use as a patch for vcpkg because there is currently an issue with find_package(wxWidgets) with vcpkg.
See microsoft/vcpkg#4756
There is a PR waiting for review that will maybe remove the need of this specific .cmake.

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}")
jmkerloch marked this conversation as resolved.
Show resolved Hide resolved
endmacro()

# Clear return values in case the module is loaded more than once.
Expand Down
26 changes: 26 additions & 0 deletions src/distrib/CMakeLists.txt.in
Original file line number Diff line number Diff line change
@@ -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()



8 changes: 4 additions & 4 deletions src/distrib/win32/NSIS.template.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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}


Expand Down
4 changes: 4 additions & 0 deletions src/distrib/win32/examplesfiles.inc.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

${SetOutPath} "$INSTDIR\Examples"

File /r ${ANTARES_SRC_DIR}\..\resources\examples\*.*
30 changes: 29 additions & 1 deletion src/distrib/win32/sourcefiles.inc.nsh
Original file line number Diff line number Diff line change
@@ -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\*.*
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\*.*
1 change: 0 additions & 1 deletion src/ext/libcurl
Submodule libcurl deleted from 3c561c
1 change: 0 additions & 1 deletion src/ext/openssl
Submodule openssl deleted from e216bf
1 change: 0 additions & 1 deletion src/ext/wxwidgets
Submodule wxwidgets deleted from 37aa81