Skip to content

Commit

Permalink
Fix rpath
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Apr 30, 2024
1 parent 0814d13 commit b1964a3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if(APPLE)
set_target_properties(cdogs-sdl PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks")
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
elseif(MSVC)
set_target_properties(cdogs-sdl PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/src")
endif()
Expand All @@ -98,7 +98,7 @@ if(BUILD_EDITOR)
set_target_properties(cdogs-sdl-editor PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks")
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
elseif(MSVC)
set_target_properties(cdogs-sdl-editor PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/src")
endif()
Expand Down
57 changes: 55 additions & 2 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ target_link_libraries(animated_counter_test
SDL2::SDL2
${EXTRA_LIBRARIES})
add_test(NAME animated_counter_test COMMAND animated_counter_test)
if(APPLE)
set_target_properties(animated_counter_test PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
endif()

add_executable(actor_test
actor_test.c
Expand All @@ -36,6 +42,12 @@ target_link_libraries(actor_test
SDL2::SDL2
${EXTRA_LIBRARIES})
add_test(NAME actor_test COMMAND actor_test)
if(APPLE)
set_target_properties(actor_test PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
endif()

add_executable(autosave_test
autosave_test.c
Expand All @@ -48,6 +60,12 @@ target_link_libraries(autosave_test
SDL2::SDL2
${EXTRA_LIBRARIES})
add_test(NAME autosave_test COMMAND autosave_test)
if(APPLE)
set_target_properties(autosave_test PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
endif()

add_executable(c_hashmap_test
c_hashmap_test.c
Expand Down Expand Up @@ -79,6 +97,12 @@ target_link_libraries(config_test
SDL2::SDL2
${EXTRA_LIBRARIES})
add_test(NAME config_test COMMAND config_test)
if(APPLE)
set_target_properties(config_test PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
endif()

add_executable(json_test json_test.c)
target_link_libraries(json_test
Expand All @@ -88,6 +112,12 @@ target_link_libraries(json_test
SDL2::SDL2
${EXTRA_LIBRARIES})
add_test(NAME json_test COMMAND json_test)
if(APPLE)
set_target_properties(json_test PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
endif()

add_executable(minkowski_hex_test minkowski_hex_test.c)
target_link_libraries(minkowski_hex_test
Expand All @@ -97,6 +127,12 @@ target_link_libraries(minkowski_hex_test
SDL2::SDL2
${EXTRA_LIBRARIES})
add_test(NAME minkowski_hex_test COMMAND minkowski_hex_test)
if(APPLE)
set_target_properties(minkowski_hex_test PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
endif()

add_executable(pic_test pic_test.c)
target_link_libraries(pic_test
Expand All @@ -106,8 +142,13 @@ target_link_libraries(pic_test
SDL2::SDL2
SDL2_image::SDL2_image
${EXTRA_LIBRARIES})
# TODO: test disabled since Travis-CI fails with "No available video device"
#add_test(NAME pic_test COMMAND pic_test)
add_test(NAME pic_test COMMAND pic_test)
if(APPLE)
set_target_properties(pic_test PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
endif()

add_executable(player_test player_test.c)
target_link_libraries(player_test
Expand All @@ -117,6 +158,12 @@ target_link_libraries(player_test
SDL2::SDL2
${EXTRA_LIBRARIES})
add_test(NAME player_test COMMAND player_test)
if(APPLE)
set_target_properties(player_test PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
endif()

add_executable(utils_test utils_test.c)
target_link_libraries(utils_test
Expand All @@ -125,3 +172,9 @@ target_link_libraries(utils_test
cdogs_proto
SDL2::SDL2 ${EXTRA_LIBRARIES})
add_test(NAME utils_test COMMAND utils_test)
if(APPLE)
set_target_properties(utils_test PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks;/Library/Frameworks")
endif()

0 comments on commit b1964a3

Please sign in to comment.