Commit da581245 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Build-time config in source tree is toxic!

parent ae0755f6
......@@ -335,6 +335,7 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../
${COMISO_INCLUDE_DIRECTORIES}
)
......@@ -421,7 +422,7 @@ acg_print_configure_header (COMISO "CoMISo")
# write config file
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/Config/config.hh.in"
"${CMAKE_CURRENT_SOURCE_DIR}/Config/config.hh" @ONLY IMMEDIATE)
"Config/config.hh" @ONLY IMMEDIATE)
......
......@@ -2,26 +2,30 @@
# 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)
# Find CoMISo config file
FIND_PATH( COMISO_INCLUDE_DIR CoMISo/Config/config.hh
FIND_PATH( COMISO_CONFIG_INCLUDE_DIR CoMISo/Config/config.hh
PATHS "${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/libs/"
"${CMAKE_BINARY_DIR}/../" )
FIND_PATH( COMISO_INCLUDE_DIR CoMISo/Solver/MISolver.hh
PATHS "${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/libs/"
"${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 "")
......@@ -225,9 +229,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}" )
......@@ -236,8 +237,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