Skip to content

Commit

Permalink
Fix some CMake warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaslundell committed Jun 14, 2024
1 parent b168892 commit 710ce94
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ file(
# Cbc

if(HAS_CBC)
find_package(CBC)
find_package(PkgConfig)

if(PkgConfig_FOUND)
include(FindPkgConfig)
find_package(CBC)
endif()

if(CBC_FOUND)
link_directories(${CBC_LIBRARY_DIRS})
Expand Down Expand Up @@ -231,7 +236,7 @@ endif(HAS_CPLEX)
# Gurobi

if(HAS_GUROBI)
find_package(Gurobi)
find_package(GUROBI)
add_definitions(-DHAS_GUROBI)

if(GUROBI_FOUND)
Expand All @@ -254,7 +259,7 @@ if(HAS_HIGHS)

if(USE_EXTERNAL_HIGHS)
find_package(Threads REQUIRED)
find_package(HIGHS REQUIRED EXACT PATHS ${HIGHS_EXTERNAL_DIR} NO_DEFAULT_PATH)
find_package(HIGHS REQUIRED PATHS ${HIGHS_EXTERNAL_DIR} NO_DEFAULT_PATH)
endif()

if(NOT(USE_EXTERNAL_HIGHS))
Expand Down
35 changes: 14 additions & 21 deletions misc/FindCBC.cmake
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
find_package(PkgConfig)

set(CBC_FOUND false)

if(PkgConfig_FOUND)
include(FindPkgConfig)

set(ENV{PKG_CONFIG_PATH} "${CBC_DIR}/lib/pkgconfig")
pkg_search_module(CBC cbc)
set(ENV{PKG_CONFIG_PATH} "${CBC_DIR}/lib/pkgconfig")
pkg_search_module(CBC cbc)

if(CBC_FOUND)
message("-- Cbc found using Pkg-config:")
message(" Include directories found: ${CBC_INCLUDE_DIRS}")
message(" Library directories found: ${CBC_LIBRARY_DIRS}")
if(CBC_FOUND)
message("-- Cbc found using Pkg-config:")
message(" Include directories found: ${CBC_INCLUDE_DIRS}")
message(" Library directories found: ${CBC_LIBRARY_DIRS}")

# Handle the QUIETLY and REQUIRED arguments and set CBC_FOUND to TRUE if all listed variables are TRUE.
find_package_handle_standard_args(CBC
DEFAULT_MSG
CBC_LIBRARIES
CBC_INCLUDE_DIRS
CBC_LIBRARY_DIRS)
mark_as_advanced(CBC_LIBRARIES CBC_INCLUDE_DIRS CBC_LIBRARY_DIRS)
endif(CBC_FOUND)

endif(PkgConfig_FOUND)
# Handle the QUIETLY and REQUIRED arguments and set CBC_FOUND to TRUE if all listed variables are TRUE.
find_package_handle_standard_args(CBC
DEFAULT_MSG
CBC_LIBRARIES
CBC_INCLUDE_DIRS
CBC_LIBRARY_DIRS)
mark_as_advanced(CBC_LIBRARIES CBC_INCLUDE_DIRS CBC_LIBRARY_DIRS)
endif(CBC_FOUND)

if(NOT (CBC_FOUND))

Expand Down
File renamed without changes.

0 comments on commit 710ce94

Please sign in to comment.