-
Notifications
You must be signed in to change notification settings - Fork 68
Integrate external project zlib, libxml2 and sundials build into main cmake build #640
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
829e17a
7d9099a
729c919
1cddde7
1f95d8c
ca34fa5
f48466d
c206388
94a3279
2f978ba
63959d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,55 @@ | ||||||
include(ExternalProject) | ||||||
set(EXTERNAL_BASE_DIR ${CMAKE_BINARY_DIR}/external CACHE STRING "External base directory") | ||||||
|
||||||
ExternalProject_Add( | ||||||
zlib_src | ||||||
PREFIX ${EXTERNAL_BASE_DIR} | ||||||
GIT_REPOSITORY https://github.com/madler/zlib.git | ||||||
GIT_TAG 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf # v1.3.1 | ||||||
GIT_SHALLOW True | ||||||
UPDATE_DISCONNECTED True | ||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_BASE_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY} -DZLIB_BUILD_MINIZIP=1 | ||||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release | ||||||
BUILD_BYPRODUCTS ${EXTERNAL_BASE_DIR}/lib/libz.a | ||||||
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config Release | ||||||
) | ||||||
add_library(zlib STATIC IMPORTED) | ||||||
set_target_properties(zlib PROPERTIES IMPORTED_LOCATION ${EXTERNAL_BASE_DIR}/lib/libz.a) | ||||||
add_dependencies(zlib zlib_src) | ||||||
|
||||||
set(ZLIB_SRC_DIR ${EXTERNAL_BASE_DIR}/src/zlib_src) | ||||||
set_source_files_properties(${ZLIB_SRC_DIR}/contrib/minizip/ioapi.c PROPERTIES GENERATED 1) | ||||||
set_source_files_properties(${ZLIB_SRC_DIR}/contrib/minizip/unzip.c PROPERTIES GENERATED 1) | ||||||
set_source_files_properties(${ZLIB_SRC_DIR}/contrib/minizip/iowin32.c PROPERTIES GENERATED 1) | ||||||
|
||||||
ExternalProject_Add( | ||||||
xml2_src | ||||||
PREFIX ${EXTERNAL_BASE_DIR} | ||||||
GIT_REPOSITORY https://github.com/GNOME/libxml2.git | ||||||
GIT_TAG 60d3056c97067e6cb2125284878ed7c99c90ed81 # v2.13.4 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per cmake document ExternalProject, commit hash should be preferred than tag. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK to keep as is. |
||||||
GIT_SHALLOW True | ||||||
UPDATE_DISCONNECTED True | ||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_BASE_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY} -DBUILD_SHARED_LIBS=OFF -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_ZLIB=OFF -DLIBXML2_WITH_TESTS=OFF | ||||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release | ||||||
BUILD_BYPRODUCTS ${EXTERNAL_BASE_DIR}/lib/libxml2.a | ||||||
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config Release | ||||||
) | ||||||
add_library(xml2 STATIC IMPORTED) | ||||||
set_target_properties(xml2 PROPERTIES IMPORTED_LOCATION ${EXTERNAL_BASE_DIR}/lib/libxml2.a) | ||||||
add_dependencies(xml2 xml2_src) | ||||||
|
||||||
ExternalProject_Add( | ||||||
cvcode_src | ||||||
PREFIX ${EXTERNAL_BASE_DIR} | ||||||
GIT_REPOSITORY https://github.com/LLNL/sundials.git | ||||||
GIT_TAG c28eaa3764a03705d61decb6025b409360e9d53f # v7.1.1 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
GIT_SHALLOW True | ||||||
UPDATE_DISCONNECTED True | ||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_BASE_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY} -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DEXAMPLES_INSTALL=OFF -DSUNDIALS_ENABLE_ERROR_CHECKS=OFF | ||||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release | ||||||
BUILD_BYPRODUCTS ${EXTERNAL_BASE_DIR}/lib/libsundials_cvode.a ${EXTERNAL_BASE_DIR}/lib/libsundials_core.a | ||||||
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config Release | ||||||
) | ||||||
add_library(cvcode STATIC IMPORTED) | ||||||
set_target_properties(cvcode PROPERTIES IMPORTED_LOCATION ${EXTERNAL_BASE_DIR}/lib/libsundials_core.a) | ||||||
add_dependencies(cvcode cvcode_src) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.