...
 
Commits (13)
......@@ -103,15 +103,18 @@ if (SUITESPARSE_FOUND )
list( APPEND COMISO_INCLUDE_DIRECTORIES ${SUITESPARSE_INCLUDE_DIRS} )
list( APPEND COMISO_LINK_DIRECTORIES ${SUITESPARSE_LIBRARY_DIRS} )
list( APPEND COMISO_LINK_LIBRARIES ${SUITESPARSE_LIBRARIES} )
# special handling, since spqr is incorrect in several distributions
if(SUITESPARSE_SPQR_VALID)
set (COMISO_SUITESPARSE_SPQR_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_SPQR_AVAILABLE 1" )
else()
message (STATUS "SUITESPARSE SPQR seems to be invalid!")
set (COMISO_SUITESPARSE_SPQR_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_SPQR_AVAILABLE 0" )
endif()
else ()
message (STATUS "SUITESPARSE not found!")
set (COMISO_SUITESPARSE_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_AVAILABLE 0" )
endif ()
# special handling, since spqr is incorrect in several distributions
if(SUITESPARSE_SPQR_VALID)
set (COMISO_SUITESPARSE_SPQR_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_SPQR_AVAILABLE 1" )
else()
message (STATUS "SUITESPARSE SPQR seems to be invalid!")
set (COMISO_SUITESPARSE_SPQR_CONFIG_FILE_SETTINGS "#define COMISO_SUITESPARSE_SPQR_AVAILABLE 0" )
endif()
......@@ -390,6 +393,10 @@ if ( QT5_FOUND )
list (APPEND COMISO_LINK_LIBRARIES ${QT_LIBRARIES})
endif()
# TODO: remove this line when we can assume people have a cmake 3.13.
# Then link directories is set as target property below.
link_directories(${COMISO_LINK_DIRECTORIES})
acg_add_library (CoMISo SHARED ${ui} ${sources} ${headers} )
target_include_directories (CoMISo PUBLIC
......@@ -402,9 +409,14 @@ target_include_directories (CoMISo PUBLIC
${COMISO_INCLUDE_DIRECTORIES}
)
set_target_properties(CoMISo PROPERTIES LINK_DIRECTORIES
${COMISO_LINK_DIRECTORIES}
)
get_target_property(INC_DIRS CoMISo INCLUDE_DIRECTORIES)
message("Target CoMISo include dirs: ${INC_DIRS}")
message("COMISO_INCLUDE_DIRECTORIES: ${COMISO_INCLUDE_DIRECTORIES}")
message("COMISO_LINK_DIRECTORIES: ${COMISO_LINK_DIRECTORIES}")
if (COMISO_LINK_DIRECTORIES)
set_target_properties(CoMISo PROPERTIES LINK_DIRECTORIES ${COMISO_LINK_DIRECTORIES})
endif()
# generate dllexport macros on windows
if (WIN32)
......
......@@ -70,16 +70,19 @@ if (WIN32)
set ( IPOPT_LIBRARY "optimized;${IPOPT_LIBRARY_RELEASE};debug;${IPOPT_LIBRARY_DEBUG}" CACHE STRING "IPOPT Libraries" )
GET_FILENAME_COMPONENT(IPOPT_LIBRARY_DIR ${IPOPT_LIBRARY_RELEASE} PATH )
MARK_AS_ADVANCED(IPOPT_LIBRARY_DIR)
GET_FILENAME_COMPONENT(IPOPT_LIBRARY_DIR ${IPOPT_LIBRARY_RELEASE} PATH )
MARK_AS_ADVANCED(IPOPT_LIBRARY_DIR)
SET(IPOPT_FOUND TRUE)
SET(IPOPT_INCLUDE_DIR ${IPOPT_INCLUDE_DIR})
SET(IPOPT_INCLUDE_DIRS ${IPOPT_INCLUDE_DIR})
SET(IPOPT_LIBRARY_DIRS ${IPOPT_LIBRARY_DIR})
set(IPOPT_LIBRARIES "${IPOPT_LIBRARY}" )
# Todo, set right version depending on build type (debug/release)
#GET_FILENAME_COMPONENT( IPOPT_LIBRARY_DIR ${GLEW_LIBRARY} PATH )
#GET_FILENAME_COMPONENT( IPOPT_LIBRARY_DIRS ${GLEW_LIBRARY} PATH )
ELSE(IPOPT_INCLUDE_DIR)
SET(IPOPT_FOUND FALSE)
SET(IPOPT_INCLUDE_DIR ${IPOPT_INCLUDE_DIR})
SET(IPOPT_INCLUDE_DIRS ${IPOPT_INCLUDE_DIR})
ENDIF(IPOPT_INCLUDE_DIR)
ELSE( WIN32 )
......@@ -117,17 +120,18 @@ ELSE( WIN32 )
PATHS "/usr/lib" )
set(IPOPT_LIBRARY_DIRS "${IPOPT_LIBRARY_DIR}" )
set(IPOPT_INCLUDE_DIRS "${IPOPT_INCLUDE_DIR}" )
set(IPOPT_LIBRARIES "${IPOPT_LIBRARY}" )
IF( IPOPT_HSL_LIBRARY_DIR)
IF( NOT IPOPT_FIND_QUIETLY )
message ( "IPOPT_HSL_LIBRARY_DIR found at ${IPOPT_HSL_LIBRARY_DIR} ")
ENDIF()
set(IPOPT_LIBRARY_DIR ${IPOPT_HSL_LIBRARY_DIR})
LIST( APPEND IPOPT_LIBRARY_DIRS "${IPOPT_HSL_LIBRARY_DIR}")
ENDIF(IPOPT_HSL_LIBRARY_DIR)
set(IPOPT_INCLUDE_DIRS "${IPOPT_INCLUDE_DIR}" )
set(IPOPT_LIBRARIES "${IPOPT_LIBRARY}" )
IF(IPOPT_HSL_LIBRARY)
LIST( APPEND IPOPT_LIBRARIES "${IPOPT_HSL_LIBRARY}")
......
This diff is collapsed.