Skip to content

Commit

Permalink
Merge branch 'lib64' into 'v80-bugfix'
Browse files Browse the repository at this point in the history
Replace hardcoded usage of lib, bin and include by cmake environment variables

See merge request integer/scip!3105
  • Loading branch information
ju-manns committed Jul 12, 2023
2 parents bf963dc + 3f0f1e6 commit cfd4a4a
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#
# interface function for setting common library properties
#
include(GNUInstallDirs)

function(setLibProperties targetname outputname)
set_target_properties(${targetname} PROPERTIES
OUTPUT_NAME ${outputname}
MACOSX_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
MACOSX_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
endfunction(setLibProperties)

set(CMAKE_C_STANDARD 99)
Expand Down Expand Up @@ -1096,27 +1098,27 @@ target_include_directories(scip PUBLIC

# set the install rpath to the installed destination
set_target_properties(scip PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH_USE_LINK_PATH TRUE)

# install the header files of scip
install(FILES ${lpiheaders} DESTINATION include/lpi)
install(FILES ${dijkstraheaders} DESTINATION include/dijkstra)
install(FILES ${objscipheaders} DESTINATION include/objscip)
install(FILES ${scipheaders} ${PROJECT_BINARY_DIR}/scip/config.h ${PROJECT_BINARY_DIR}/scip/scip_export.h DESTINATION include/scip)
install(FILES ${tcliqueheaders} DESTINATION include/tclique)
install(FILES ${tinycthreadheader} DESTINATION include/tinycthread)
install(FILES ${tpiheaders} DESTINATION include/tpi)
install(FILES ${xmlheaders} DESTINATION include/xml)
install(FILES ${symheaders} DESTINATION include/symmetry)
install(FILES ${blockmemshellheader} DESTINATION include/blockmemshell)
install(FILES ${lpiheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lpi)
install(FILES ${dijkstraheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dijkstra)
install(FILES ${objscipheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/objscip)
install(FILES ${scipheaders} ${PROJECT_BINARY_DIR}/scip/config.h ${PROJECT_BINARY_DIR}/scip/scip_export.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/scip)
install(FILES ${tcliqueheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tclique)
install(FILES ${tinycthreadheader} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tinycthread)
install(FILES ${tpiheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tpi)
install(FILES ${xmlheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xml)
install(FILES ${symheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/symmetry)
install(FILES ${blockmemshellheader} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/blockmemshell)

# install the binary and the library to appropriate locations and add them to an export group
install(TARGETS scip libscip EXPORT scip-targets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include)
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# Add all targets to the build-tree export set
export(TARGETS scip libscip ${BLISS_TARGET}
Expand Down Expand Up @@ -1156,7 +1158,7 @@ configure_file(${PROJECT_SOURCE_DIR}/scip-config.cmake.in

# install the targets of the scip export group and the config file so that other projects
# can link easily against scip
install(EXPORT scip-targets DESTINATION lib/cmake/scip)
install(EXPORT scip-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/scip)
install(FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/scip-config.cmake"
${PROJECT_BINARY_DIR}/scip-config-version.cmake
DESTINATION lib/cmake/scip)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/scip)

0 comments on commit cfd4a4a

Please sign in to comment.