Skip to content

Commit

Permalink
cmake: Add GLPK::glpsol
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Nov 11, 2021
1 parent f910118 commit 5f1aa43
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
if(APPLE)
set(CMAKE_INSTALL_RPATH
"@loader_path/../${CMAKE_INSTALL_LIBDIR};@loader_path")
elseif(UNIX)
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:$ORIGIN")
endif()

add_executable(glpsol glpsol.c)
target_compile_features(glpsol PRIVATE c_std_11)
target_link_libraries(glpsol PRIVATE
${PROJECT_NAMESPACE}::GLPK
$<$<NOT:$<C_COMPILER_ID:MSVC>>:m>)
add_executable(${PROJECT_NAMESPACE}::glpsol ALIAS glpsol)

install(TARGETS glpsol
EXPORT ${PROJECT_NAME}Targets)

if(NOT BUILD_EXAMPLES)
return()
endif()
Expand Down

0 comments on commit 5f1aa43

Please sign in to comment.