-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[check,libsbml] Update, port fixes #34656
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
17323a0
[libsbml] Update, port fixes
dg0yt 4f13051
[check] Follow VCPKG_LIBRARY_LINKAGE
dg0yt 7a63461
[check] Don't install checkmk
dg0yt 1c7ea03
[check] Burn-in dllimport
dg0yt b213b83
[libsbml] Devendor dirent
dg0yt a01f35f
[libsbml] Burn-in library linkage
dg0yt 4cf0b29
Finish
dg0yt 5a16780
Fix typo
dg0yt 95703d7
[libsbml] Shorten patch
dg0yt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 4a02dbe..3e147e4 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -188,7 +188,14 @@ target_include_directories(checkShared | ||
) | ||
|
||
if(NOT THIS_IS_SUBPROJECT) | ||
- install(TARGETS check checkShared | ||
+ if(BUILD_SHARED_LIBS) | ||
+ set(lib checkShared) | ||
+ set_target_properties(check PROPERTIES EXCLUDE_FROM_ALL 1) | ||
+ else() | ||
+ set(lib check) | ||
+ set_target_properties(checkShared PROPERTIES EXCLUDE_FROM_ALL 1) | ||
+ endif() | ||
+ install(TARGETS ${lib} | ||
EXPORT check-targets | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/manual-link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
check provides CMake targets: | ||
|
||
find_package(check CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:Check::check>,Check::check,Check::checkShared>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index a8af3a4..3926b68 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -421,8 +421,9 @@ set(LIBSBML_XML_LIBRARY_LIBS) | ||
if(WITH_EXPAT) | ||
|
||
if(NOT TARGET EXPAT::EXPAT) | ||
- find_package(EXPAT REQUIRED) | ||
endif() | ||
+ find_package(EXPAT NAMES expat REQUIRED) | ||
+ set(EXPAT_LIBRARY expat::expat) | ||
|
||
add_definitions( -DUSE_EXPAT ) | ||
list(APPEND SWIG_EXTRA_ARGS -DUSE_EXPAT) | ||
@@ -443,7 +444,8 @@ endif(WITH_EXPAT) | ||
set(USE_LIBXML OFF) | ||
if(WITH_LIBXML) | ||
|
||
- find_package(LIBXML REQUIRED) | ||
+ find_package(LIBXML NAMES LibXml2 REQUIRED) | ||
+ set(LIBXML_LIBRARY LibXml2::LibXml2) | ||
|
||
add_definitions( -DUSE_LIBXML ) | ||
list(APPEND SWIG_EXTRA_ARGS -DUSE_LIBXML) | ||
@@ -495,7 +497,9 @@ endif() | ||
option(WITH_BZIP2 "Enable the use of bzip2 compression." ${BZIP_INITIAL_VALUE}) | ||
set(USE_BZ2 OFF) | ||
if(WITH_BZIP2) | ||
- find_package(BZ2 REQUIRED) | ||
+ if(NOT TARGET BZ2::BZ2) | ||
+ endif() | ||
+ find_package(BZip2 REQUIRED) | ||
set(USE_BZ2 ON) | ||
add_definitions( -DUSE_BZ2 ) | ||
list(APPEND SWIG_EXTRA_ARGS -DUSE_BZ2) | ||
@@ -521,6 +525,9 @@ Separate multiple directories using semicolons." ) | ||
# Locate zlib | ||
# | ||
|
||
+if(WITH_ZLIB) | ||
+ find_package(ZLIB REQUIRED) | ||
+endif() | ||
set(ZLIB_INITIAL_VALUE) | ||
if (NOT LIBZ_LIBRARY) | ||
find_library(LIBZ_LIBRARY | ||
@@ -614,7 +621,6 @@ valid. It should contain the file zlib.h, but it does not.") | ||
endif(WITH_ZLIB) | ||
|
||
# install find scripts only for used dependencies | ||
-install(FILES ${LIBSBML_FIND_MODULES} DESTINATION share/cmake/Modules) | ||
|
||
############################################################################### | ||
# | ||
@@ -671,7 +677,12 @@ if(WITH_CHECK) | ||
|
||
enable_testing() | ||
|
||
- find_package(CHECK REQUIRED) | ||
+ find_package(CHECK NAMES check REQUIRED) | ||
+ if(BUILD_SHARED_LIBS) | ||
+ add_library(CHECK::CHECK ALIAS Check::checkShared) | ||
+ else() | ||
+ add_library(CHECK::CHECK ALIAS Check::check) | ||
+ endif() | ||
|
||
if (UNIX) | ||
# setup valgrind | ||
@@ -1005,17 +1016,18 @@ install(FILES ${DOCUMENTATION_FILES} DESTINATION ${MISC_PREFIX}) | ||
# | ||
|
||
set (PRIVATE_LIBS "-lstdc++ -lm") | ||
+set (PRIVATE_REQUIRES "") | ||
if (WITH_ZLIB) | ||
-set (PRIVATE_LIBS "${LIBZ_LIBRARY} ${PRIVATE_LIBS}") | ||
+ string(APPEND PRIVATE_REQUIRES " zlib") | ||
endif() | ||
if (WITH_BZIP2) | ||
-set (PRIVATE_LIBS "${LIBBZ_LIBRARY} ${PRIVATE_LIBS}") | ||
+ string(APPEND PRIVATE_REQUIRES " bzip2") | ||
endif() | ||
if (WITH_LIBXML) | ||
-set (PRIVATE_LIBS "${LIBXML_LIBRARY} ${PRIVATE_LIBS}") | ||
+ string(APPEND PRIVATE_REQUIRES " libxml-2.0") | ||
endif() | ||
if (WITH_EXPAT) | ||
-set (PRIVATE_LIBS "${LIBEXPAT_LIBRARY} ${PRIVATE_LIBS}") | ||
+ string(APPEND PRIVATE_REQUIRES " expat") | ||
endif() | ||
if (WITH_XERCES) | ||
set (PRIVATE_LIBS "${XERCES_LIBRARY} ${PRIVATE_LIBS}") | ||
@@ -1037,9 +1049,7 @@ if (WITH_XERCES) | ||
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/libsbml.pc" "Conflicts: xerces-c = 2.6.0\n") | ||
endif() | ||
|
||
-if (WITH_LIBXML) | ||
-file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/libsbml.pc" "Requires.private: libxml-2.0 >= 2.6.22\n") | ||
-endif() | ||
+file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/libsbml.pc" "Requires.private: ${PRIVATE_REQUIRES}\n") | ||
|
||
if (UNIX OR MINGW) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libsbml.pc" | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 79301a6..0957d29 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -311,7 +311,7 @@ if(WITH_BZIP2) | ||
sbml/compress/bzfstream.h | ||
sbml/compress/bzfstream.cpp | ||
) | ||
- set(LIBSBML_LIBS ${LIBSBML_LIBS} BZ2::BZ2) | ||
+ set(LIBSBML_LIBS ${LIBSBML_LIBS} BZip2::BZip2) | ||
|
||
endif() | ||
|
||
@@ -405,7 +405,7 @@ if(WITH_EXPAT) | ||
sbml/xml/ExpatHandler.h | ||
sbml/xml/ExpatParser.h | ||
) | ||
- set(LIBSBML_LIBS ${LIBSBML_LIBS} EXPAT::EXPAT) | ||
+ set(LIBSBML_LIBS ${LIBSBML_LIBS} expat::expat) | ||
|
||
endif(WITH_EXPAT) | ||
|
||
@@ -423,7 +423,7 @@ if(WITH_LIBXML) | ||
sbml/xml/LibXMLParser.h | ||
sbml/xml/LibXMLTranscode.h | ||
) | ||
- set(LIBSBML_LIBS ${LIBSBML_LIBS} LIBXML::LIBXML) | ||
+ set(LIBSBML_LIBS ${LIBSBML_LIBS} LibXml2::LibXml2) | ||
|
||
endif(WITH_LIBXML) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/src/sbml/validator/test/tps/dirent.c b/src/sbml/validator/test/tps/dirent.c | ||
index beafc5e..48a60ca 100644 | ||
--- a/src/sbml/validator/test/tps/dirent.c | ||
+++ b/src/sbml/validator/test/tps/dirent.c | ||
@@ -1,3 +1,4 @@ | ||
+#if 0 | ||
/* ///////////////////////////////////////////////////////////////////////////// | ||
* File: dirent.c | ||
* | ||
@@ -239,3 +240,4 @@ struct dirent *readdir(DIR *dir) | ||
} | ||
|
||
/* ////////////////////////////////////////////////////////////////////////// */ | ||
+#endif | ||
diff --git a/src/sbml/validator/test/tps/dirent.h b/src/sbml/validator/test/tps/dirent.h | ||
index 4703aa2..8e4c29c 100644 | ||
--- a/src/sbml/validator/test/tps/dirent.h | ||
+++ b/src/sbml/validator/test/tps/dirent.h | ||
@@ -46,6 +46,9 @@ | ||
|
||
#ifndef SYNSOFT_UNIXEM_INCL_H_DIRENT | ||
#define SYNSOFT_UNIXEM_INCL_H_DIRENT | ||
+#include <dirent.h> | ||
+#endif | ||
+#if 0 | ||
|
||
#ifndef _SYNSOFT_DOCUMENTATION_SKIP_SECTION | ||
# define SYNSOFT_UNIXEM_VER_H_DIRENT_MAJOR 2 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
include(CMakeFindDependencyMacro) | ||
find_dependency(libsbml-static CONFIG) | ||
find_dependency(@name@ CONFIG) | ||
if(NOT TARGET libsbml) | ||
add_library(libsbml INTERFACE IMPORTED) | ||
target_link_libraries(libsbml INTERFACE libsbml-static) | ||
target_link_libraries(libsbml INTERFACE $<TARGET_NAME:@name@>) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 8ad678a..f856774 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1012,7 +1012,6 @@ set(DOCUMENTATION_FILES | ||
VERSION.txt | ||
) | ||
|
||
-install(FILES ${DOCUMENTATION_FILES} DESTINATION ${MISC_PREFIX}) | ||
|
||
############################################################################### | ||
# |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm assuming this find_package is supposed to be inside the if statement?
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.
No. It is meant to be called without guard.