Commit 62b44903 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Build-time config in source tree is toxic!

parent 243c5bf6
Pipeline #90 skipped
......@@ -2,34 +2,39 @@
# Once done this will define
#
# COMISO_FOUND - system has COMISO
# COMISO_INCLUDE_DIR - the COMISO include directory
# COMISO_INCLUDE_DIRS - the COMISO include directory
# COMISO_LIBRARY_DIR - where the libraries are
# COMISO_LIBRARY - Link these to use COMISO
IF (COMISO_INCLUDE_DIR)
IF (COMISO_INCLUDE_DIRS)
# Already in cache, be silent
SET(COMISO_FIND_QUIETLY TRUE)
ENDIF (COMISO_INCLUDE_DIR)
ENDIF (COMISO_INCLUDE_DIRS)
# search all lib directories in packages for OpenFlipper
file (
GLOB _libdirs
"${CMAKE_SOURCE_DIR}/libs"
"${CMAKE_SOURCE_DIR}/Package-*/libs"
"${CMAKE_BINARY_DIR}/libs"
"${CMAKE_BINARY_DIR}/Package-*/libs"
)
# Find CoMISo config file
FIND_PATH( COMISO_INCLUDE_DIR CoMISo/Config/config.hh
PATHS "${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/libs/"
"${_libdirs}"
FIND_PATH( COMISO_CONFIG_INCLUDE_DIR CoMISo/Config/config.hh
PATHS ${_libdirs}
"${CMAKE_BINARY_DIR}/../" )
FIND_PATH( COMISO_INCLUDE_DIR CoMISo/Solver/MISolver.hh
PATHS ${_libdirs}
"${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/../" )
if ( COMISO_INCLUDE_DIR )
if ( COMISO_INCLUDE_DIR AND COMISO_CONFIG_INCLUDE_DIR )
FILE(READ ${COMISO_INCLUDE_DIR}/CoMISo/Config/config.hh CURRENT_COMISO_CONFIG)
FILE(READ ${COMISO_CONFIG_INCLUDE_DIR}/CoMISo/Config/config.hh CURRENT_COMISO_CONFIG)
set(COMISO_OPT_DEPS "")
......@@ -233,9 +238,6 @@ if ( COMISO_INCLUDE_DIR )
add_definitions (-DCOMISODLL -DUSECOMISO )
endif(COMISO_INCLUDE_DIR)
IF (COMISO_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
SET(COMISO_FOUND TRUE)
SET( COMISO_LIBRARY_DIR "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}" )
......@@ -244,8 +246,11 @@ IF (COMISO_INCLUDE_DIR)
SET( COMISO_DEPS "GMM")
# SET( COMISO_OPT_DEPS ${COMISO_OPT_DEPS} CACHE STRING "Comiso optional dependecies")
# mark_as_advanced(COMISO_DEPS COMISO_OPT_DEPS)
ELSE (COMISO_INCLUDE_DIR)
SET( COMISO_INCLUDE_DIRS ${COMISO_INCLUDE_DIR};${COMISO_CONFIG_INCLUDE_DIR} )
# For backwards compat:
SET( COMISO_INCLUDE_DIR ${COMISO_INCLUDE_DIRS} )
ELSE (COMISO_INCLUDE_DIR AND COMISO_CONFIG_INCLUDE_DIR)
SET( COMISO_FOUND FALSE )
SET( COMISO_LIBRARY_DIR )
ENDIF (COMISO_INCLUDE_DIR)
ENDIF (COMISO_INCLUDE_DIR AND COMISO_CONFIG_INCLUDE_DIR)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment