-
Notifications
You must be signed in to change notification settings - Fork 28
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
Can't build with MSVC 2019 and C++17 support? #240
Comments
Hello Alan, this has already been resolved in the current branch and pre releases. We currently dont have the capacity to build all the binaries we did before, so we marked it as prerelease. But either development, or: https://github.com/sbmlteam/libsbml/releases/tag/v5.19.5 should work for you. best |
Thanks @fbergmann, my bad for not checking the tags! FWIW, I build my own copy of
If I modify I guess I should stress that I am building static versions of |
That test is trying to discover potential dependencies of libxml (such as iconv and others), and whether the |
Oops, my bad, I should have indeed attached the log files. Here they are: CMakeError.log and CMakeOutput.log. As you can tell from |
good to know! Then i'll just look for the math library and if found link against it for the test. Does this work for you diff --git a/CMakeModules/FindLIBXML.cmake b/CMakeModules/FindLIBXML.cmake
index 8e6318138..73e5f5ae7 100644
--- a/CMakeModules/FindLIBXML.cmake
+++ b/CMakeModules/FindLIBXML.cmake
@@ -1,3 +1,5 @@
+include(CheckLibraryExists)
+
string(TOUPPER ${PROJECT_NAME} _UPPER_PROJECT_NAME)
set(_PROJECT_DEPENDENCY_DIR ${_UPPER_PROJECT_NAME}_DEPENDENCY_DIR)
@@ -23,7 +25,7 @@ find_path(LIBXML_INCLUDE_DIR
PATHS ${${_PROJECT_DEPENDENCY_DIR}}/include
${${_PROJECT_DEPENDENCY_DIR}}/include/libxml2
NO_DEFAULT_PATH
-)
+)
if (NOT LIBXML_INCLUDE_DIR)
@@ -71,6 +73,13 @@ if (WIN32)
set(ADDITIONAL_LIBS "ws2_32.lib;${ADDITIONAL_LIBS}")
endif()
+
+CHECK_LIBRARY_EXISTS(m sin "" HAVE_LIB_M)
+
+if (HAVE_LIB_M)
+ set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} m)
+endif (HAVE_LIB_M)
+
if(NOT TARGET LIBXML::LIBXML)
add_library(LIBXML::LIBXML UNKNOWN IMPORTED)
set_target_properties(LIBXML::LIBXML PROPERTIES
@@ -83,7 +92,7 @@ endif()
# figure out if we need XML_STATIC flag
if (LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
-
+
set(LIBXML_LIBXML_CODE
"
#include <libxml/xmlversion.h>
@@ -130,10 +139,10 @@ if (LIBXML_LIBXML_TEST2)
)
else()
message(FATAL_ERROR "Unable to compile a test executable against LIBXML
-
+
LIBXML_INCLUDE_DIR = ${LIBXML_INCLUDE_DIR}
LIBXML_LIBRARY = ${LIBXML_LIBRARY}
-
+
")
endif()
@@ -143,7 +152,7 @@ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_CACHE})
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_CACHE})
set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_CACHE})
endif()
-
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
|
Hi @fbergmann, yes, it's all good. 🥳 Would be nice to have 5.19.6. |
i'll make a new (preview) release, as soon as the fbc v3 issue is resolved |
Any chance of getting libSBML to build with MSVC 2019 and C++17 support? Here is the output I am getting if I try:
The text was updated successfully, but these errors were encountered: