-
Notifications
You must be signed in to change notification settings - Fork 4
Added options, system includes, funcs and libs #1
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
Open
Two4
wants to merge
53
commits into
Mizux:main
Choose a base branch
from
Two4:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
bbce4a8
Added CMake options from autoconf and find-package Find*.cmake files
7c6d053
Added checks and includes for system libs, functions and headers
04d7e16
gitignore CLion IDE files
67bcbfc
fixed missing CMake includes
ebc2f7e
fixed compile definitions
8865447
added missing gmp.h
d2e14a6
Moved `Find*.cmake` to ./cmake, removed `set(CMAKE_MODULE_PATH ".")`
7f7a608
added `glpsol` executable target plus tests
6aa1ef2
replaced hardcoded paths with CMake variables
7afddc0
removed `gmp.h`, added `find_path` to find it on the host system
0237935
removed `gmp.h`, added `find_path` to find it on the host system
ce26bb1
fixed copy-paste code errors, added missing `GPSOL` target include di…
a96f6e5
Merge branch 'Mizux:main' into main
Two4 bd4887e
revert GPSOL changes in favour of MUCH better upstream GPSOL changes
f384b7b
added GPSOL smoke tests
ab69078
switched to dune-common version of `FindGMP.cmake`
ca65817
added default `OFF` for CMake option `ODBC`
bbab4a7
removed lingering GPSOL change
3120d10
clarified TLS comment
99bfeb6
another GLPSOL change reverted
0ba82af
Fixed `target_link_libraries` not working on *nix
baa2fbb
Fixed `target_link_libraries` not working on *nix
ba81562
removed unneeded math lib check
93a76fb
Merge remote-tracking branch 'origin/main' into main
41a7ffd
remove unused CMake vars
0ea516f
use `find_package(ODBC)` rather than `include(FindODBC)` for more con…
81d93e0
escape parentheses
aa62013
fixed misleading comment - DLLs are supported, but default off on Win…
7d4476f
allow `WITH_GMP` on Windows, but default to `OFF`
5958194
fixed `gettimeofday` function check
e78e02b
added libm link for examples (some were failing)
d76dbf8
moved example directory target enumeration to its own function
6fd2ccd
changed `add_compile_definitions` to `target_compile_definitions` as …
04b909c
fixed gpsol smoke tests
14fa8e6
used new `add_example_folder` function to add all tests/examples and …
b6d6153
copy library to test output dirs to allow tests to run
1461d81
CMake will now always try to find libgmp, but will warn and continue …
24be42f
remove cplex example due to missing external deps
2cdd7f7
include src folder for examples
49f3d0a
added missing define for MSVC builds, restructured system checks
8c27127
missing libgmp now gives dev warning instead of warning
2d6693b
libgmp check no longer depends on option, moved to `src/CmakeLists.txt`
a788400
added missing GLPK dependence for tsp examples
aaf643a
comment out problematic `#include <malloc.h>` (non-standard, deprecated)
c70e08e
changed dependencies around for tsp libs
24ef74b
try to fix failing test on XCode
1403065
add option status messages for configure/build logs
49ed231
added warning message when compiler not recognised for thread-local s…
516f69f
moved example data configuration to its own function
3b0511f
tspsol and tsplib are now project exports, and their dependencies are…
dd67aef
now using ODBC::ODBC target as dependency
b366105
fixed copy-paste code mistake
81b239e
removed copying of glpk lib to example directories (no longer applica…
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 hidden or 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 hidden or 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,180 @@ | ||
| #### LICENSE #### | ||
| # This file is copied from the Dune project (http://dune-project.org/), specifically the dune-project/dune-common git | ||
| # repo (https://github.com/dune-project/dune-common), and is thus licensed under a modified GPLv2 license. A copy of | ||
| # that license can be found in this directory as `dune-common-gplv2.md`. | ||
| # | ||
| # The original file can be found at https://github.com/dune-project/dune-common/blob/v2.8.0/cmake/modules/FindGMP.cmake | ||
| # | ||
| # Copyright holders: | ||
| # ================== | ||
| # | ||
| # 2015--2017 Marco Agnese | ||
| # 2015 Martin Alkämper | ||
| # 2003--2019 Peter Bastian | ||
| # 2004--2020 Markus Blatt | ||
| # 2013 Andreas Buhr | ||
| # 2020--2021 Samuel Burbulla | ||
| # 2011--2020 Ansgar Burchardt | ||
| # 2004--2005 Adrian Burri | ||
| # 2014 Benjamin Bykowski (may appear in the logs as "Convex Function") | ||
| # 2014 Marco Cecchetti | ||
| # 2018 Matthew Collins | ||
| # 2006--2021 Andreas Dedner | ||
| # 2019--2021 Nils-Arne Dreier | ||
| # 2003 Marc Droske | ||
| # 2003--2021 Christian Engwer | ||
| # 2004--2020 Jorrit Fahlke | ||
| # 2016 Thomas Fetzer | ||
| # 2008--2017 Bernd Flemisch | ||
| # 2013--2014 Christoph Gersbacher | ||
| # 2017--2020 Janick Gerstenberger | ||
| # 2015 Stefan Girke | ||
| # 2005--2021 Carsten Gräser | ||
| # 2015--2017 Felix Gruber | ||
| # 2010--2021 Christoph Grüninger | ||
| # 2006 Bernhard Haasdonk | ||
| # 2015--2018 Claus-Justus Heine | ||
| # 2015--2020 René Heß | ||
| # 2017--2019 Stephan Hilb | ||
| # 2017--2021 Lasse Hinrichsen | ||
| # 2012--2013 Olaf Ippisch | ||
| # 2020 Patrick Jaap | ||
| # 2020 Liam Keegan | ||
| # 2013--2021 Dominic Kempf | ||
| # 2009 Leonard Kern | ||
| # 2017--2018 Daniel Kienle | ||
| # 2013 Torbjörn Klatt | ||
| # 2003--2021 Robert Klöfkorn | ||
| # 2017--2021 Timo Koch | ||
| # 2005--2007 Sreejith Pulloor Kuttanikkad | ||
| # 2012--2016 Arne Morten Kvarving | ||
| # 2010--2014 Andreas Lauser | ||
| # 2016--2019 Tobias Leibner | ||
| # 2015 Lars Lubkoll | ||
| # 2012--2017 Tobias Malkmus | ||
| # 2007--2011 Sven Marnach | ||
| # 2010--2017 Rene Milk | ||
| # 2019--2020 Felix Müller | ||
| # 2011--2019 Steffen Müthing | ||
| # 2018 Lisa Julia Nebel | ||
| # 2003--2006 Thimo Neubauer | ||
| # 2011 Rebecca Neumann | ||
| # 2008--2018 Martin Nolte | ||
| # 2014 Andreas Nüßing | ||
| # 2004--2005 Mario Ohlberger | ||
| # 2019--2020 Santiago Ospina De Los Rios | ||
| # 2014 Steffen Persvold | ||
| # 2008--2017 Elias Pipping | ||
| # 2021 Joscha Podlesny | ||
| # 2011 Dan Popovic | ||
| # 2017--2021 Simon Praetorius | ||
| # 2009 Atgeirr Rasmussen | ||
| # 2017--2020 Lukas Renelt | ||
| # 2006--2014 Uli Sack | ||
| # 2003--2020 Oliver Sander | ||
| # 2006 Klaus Schneider | ||
| # 2004 Roland Schulz | ||
| # 2015 Nicolas Schwenck | ||
| # 2016 Linus Seelinger | ||
| # 2009--2014 Bård Skaflestad | ||
| # 2019 Henrik Stolzmann | ||
| # 2012 Matthias Wohlmuth | ||
| # 2011--2016 Jonathan Youett | ||
|
|
||
| #[=======================================================================[.rst: | ||
| FindGMP | ||
| ------- | ||
|
|
||
| Find the GNU MULTI-Precision Bignum (GMP) library | ||
| and the corresponding C++ bindings GMPxx. | ||
|
|
||
| This module searches for both libraries and only considers the package | ||
| found if both can be located. It then defines separate targets for the C | ||
| and the C++ library. | ||
|
|
||
| Imported Targets | ||
| ^^^^^^^^^^^^^^^^ | ||
|
|
||
| This module provides the following imported targets, if found: | ||
|
|
||
| ``GMP::gmp`` | ||
| Library target of the C library. | ||
| ``GMP::gmpxx`` | ||
| Library target of the C++ library, which also links to the C library. | ||
|
|
||
| Result Variables | ||
| ^^^^^^^^^^^^^^^^ | ||
|
|
||
| This will define the following variables: | ||
|
|
||
| ``GMP_FOUND`` | ||
| True if the GMP library, the GMPxx headers and | ||
| the GMPxx library were found. | ||
|
|
||
| Cache Variables | ||
| ^^^^^^^^^^^^^^^ | ||
|
|
||
| You may set the following variables to modify the behaviour of | ||
| this module: | ||
|
|
||
| ``GMP_INCLUDE_DIR`` | ||
| The directory containing ``gmp.h``. | ||
| ``GMP_LIB`` | ||
| The path to the gmp library. | ||
| ``GMPXX_INCLUDE_DIR`` | ||
| The directory containing ``gmpxx.h``. | ||
| ``GMPXX_LIB`` | ||
| The path to the gmpxx library. | ||
|
|
||
| #]=======================================================================] | ||
|
|
||
| # Add a feature summary for this package | ||
| include(FeatureSummary) | ||
| set_package_properties(GMP PROPERTIES | ||
| DESCRIPTION "GNU multi-precision library" | ||
| URL "https://gmplib.org" | ||
| ) | ||
|
|
||
| # Try finding the package with pkg-config | ||
| find_package(PkgConfig QUIET) | ||
| pkg_check_modules(PKG QUIET gmp gmpxx) | ||
|
|
||
| # Try to locate the libraries and their headers, using pkg-config hints | ||
| find_path(GMP_INCLUDE_DIR gmp.h HINTS ${PKG_gmp_INCLUDEDIR}) | ||
| find_library(GMP_LIB gmp HINTS ${PKG_gmp_LIBDIR}) | ||
|
|
||
| find_path(GMPXX_INCLUDE_DIR gmpxx.h HINTS ${PKG_gmpxx_INCLUDEDIR}) | ||
| find_library(GMPXX_LIB gmpxx HINTS ${PKG_gmpxx_LIBDIR}) | ||
|
|
||
| # Remove these variables from cache inspector | ||
| mark_as_advanced(GMP_INCLUDE_DIR GMP_LIB GMPXX_INCLUDE_DIR GMPXX_LIB) | ||
|
|
||
| # Report if package was found | ||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(GMP | ||
| DEFAULT_MSG | ||
| GMPXX_LIB GMPXX_INCLUDE_DIR GMP_INCLUDE_DIR GMP_LIB | ||
| ) | ||
|
|
||
| # Set targets | ||
| if(GMP_FOUND) | ||
| # C library | ||
| if(NOT TARGET GMP::gmp) | ||
| add_library(GMP::gmp UNKNOWN IMPORTED) | ||
| set_target_properties(GMP::gmp PROPERTIES | ||
| IMPORTED_LOCATION ${GMP_LIB} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${GMP_INCLUDE_DIR} | ||
| ) | ||
| endif() | ||
|
|
||
| # C++ library, which requires a link to the C library | ||
| if(NOT TARGET GMP::gmpxx) | ||
| add_library(GMP::gmpxx UNKNOWN IMPORTED) | ||
| set_target_properties(GMP::gmpxx PROPERTIES | ||
| IMPORTED_LOCATION ${GMPXX_LIB} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${GMPXX_INCLUDE_DIR} | ||
| INTERFACE_LINK_LIBRARIES GMP::gmp | ||
| ) | ||
| endif() | ||
|
|
||
| endif() |
This file contains hidden or 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,75 @@ | ||
| # https://gist.github.com/RenatoUtsch/1623340 | ||
| # - Try to find MySQL. | ||
| # Once done this will define: | ||
| # MYSQL_FOUND - If false, do not try to use MySQL. | ||
| # MYSQL_INCLUDE_DIRS - Where to find mysql.h, etc. | ||
| # MYSQL_LIBRARIES - The libraries to link against. | ||
| # MYSQL_VERSION_STRING - Version in a string of MySQL. | ||
| # | ||
| # Created by RenatoUtsch based on eAthena implementation. | ||
| # | ||
| # Please note that this module only supports Windows and Linux officially, but | ||
| # should work on all UNIX-like operational systems too. | ||
| # | ||
| #============================================================================= | ||
| # Copyright 2012 RenatoUtsch | ||
| # | ||
| # Distributed under the OSI-approved BSD License (the "License"); | ||
| # see accompanying file Copyright.txt for details. | ||
| # | ||
| # This software is distributed WITHOUT ANY WARRANTY; without even the | ||
| # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| # See the License for more information. | ||
| #============================================================================= | ||
| # (To distribute this file outside of CMake, substitute the full | ||
| # License text for the above reference.) | ||
| if( WIN32 ) | ||
| find_path( MYSQL_INCLUDE_DIR | ||
| NAMES "mysql.h" | ||
| PATHS "$ENV{PROGRAMFILES}/MySQL/*/include" | ||
| "$ENV{PROGRAMFILES\(x86\)}/MySQL/*/include" | ||
| "$ENV{SYSTEMDRIVE}/MySQL/*/include" ) | ||
|
|
||
| find_library( MYSQL_LIBRARY | ||
| NAMES "mysqlclient" "mysqlclient_r" | ||
| PATHS "$ENV{PROGRAMFILES}/MySQL/*/lib" | ||
| "$ENV{PROGRAMFILES\(x86\)}/MySQL/*/lib" | ||
| "$ENV{SYSTEMDRIVE}/MySQL/*/lib" ) | ||
| else() | ||
| find_path( MYSQL_INCLUDE_DIR | ||
| NAMES "mysql.h" | ||
| PATHS "/usr/include/mysql" | ||
| "/usr/local/include/mysql" | ||
| "/usr/mysql/include/mysql" ) | ||
|
|
||
| find_library( MYSQL_LIBRARY | ||
| NAMES "mysqlclient" "mysqlclient_r" | ||
| PATHS "/lib/mysql" | ||
| "/lib64/mysql" | ||
| "/usr/lib/mysql" | ||
| "/usr/lib64/mysql" | ||
| "/usr/local/lib/mysql" | ||
| "/usr/local/lib64/mysql" | ||
| "/usr/mysql/lib/mysql" | ||
| "/usr/mysql/lib64/mysql" ) | ||
| endif() | ||
|
|
||
| if( MYSQL_INCLUDE_DIR AND EXISTS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" ) | ||
| file( STRINGS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" | ||
| MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" ) | ||
| string( REGEX REPLACE | ||
| "^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING | ||
| "${MYSQL_VERSION_H}" ) | ||
| endif() | ||
|
|
||
| # handle the QUIETLY and REQUIRED arguments and set MYSQL_FOUND to TRUE if | ||
| # all listed variables are TRUE | ||
| include( FindPackageHandleStandardArgs ) | ||
| find_package_handle_standard_args( MYSQL DEFAULT_MSG | ||
| REQUIRED_VARS MYSQL_LIBRARY MYSQL_INCLUDE_DIR | ||
| VERSION_VAR MYSQL_VERSION_STRING ) | ||
|
|
||
| set( MYSQL_INCLUDE_DIRS ${MYSQL_INCLUDE_DIR} ) | ||
| set( MYSQL_LIBRARIES ${MYSQL_LIBRARY} ) | ||
|
|
||
| mark_as_advanced( MYSQL_INCLUDE_DIR MYSQL_LIBRARY ) |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.