Skip to content

Commit

Permalink
Add JsonCpp targets if missing (raceintospace#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkosciusz committed Aug 12, 2024
1 parent 2bccdd5 commit 33c70c4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ else("${lc_CMAKE_BUILD_TYPE}" STREQUAL "debug")
endif("${lc_CMAKE_BUILD_TYPE}" STREQUAL "debug")

add_custom_target(tag
COMMAND ${GIT} tag -a v${raceintospace_VERSION_FULL})
COMMAND ${GIT} tag -a v${raceintospace_VERSION_FULL})
9 changes: 9 additions & 0 deletions cmake/FixJsonCppTargets.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if (NOT TARGET JsonCpp::JsonCpp)
if (TARGET jsoncpp_static)
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
elseif (TARGET jsoncpp_lib)
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
endif ()
endif ()
1 change: 1 addition & 0 deletions src/game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ find_package(Ogg REQUIRED)
find_package(unofficial-theora REQUIRED) # name from vcpkg ports
find_package(Vorbis REQUIRED)
find_package(jsoncpp REQUIRED)
include(FixJsonCppTargets)
find_package(cereal REQUIRED)
find_package(Boost REQUIRED)
find_package(ZLIB REQUIRED)
Expand Down
1 change: 1 addition & 0 deletions src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/utils")
find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(jsoncpp REQUIRED)
include(FixJsonCppTargets)

add_executable(but2png EXCLUDE_FROM_ALL but2png.c)
set_target_properties(but2png PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
Expand Down

0 comments on commit 33c70c4

Please sign in to comment.