Skip to content

Commit

Permalink
Fix support for ion-c used with add_subdirectory in parent project (#338
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nirosys authored Feb 14, 2024
1 parent 6d4de41 commit 1dc0e0b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ set(IONC_FULL_VERSION ${CMAKE_PROJECT_VERSION})
find_program(GIT_EXECUTABLE "git")
add_custom_target(
version
${CMAKE_COMMAND} -D SRC=${CMAKE_SOURCE_DIR}/build_version.h.in
-D DST=${CMAKE_BINARY_DIR}/build_version.h
${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/build_version.h.in
-D DST=${CMAKE_CURRENT_BINARY_DIR}/build_version.h
-D GIT_EXECUTABLE=${GIT_EXECUTABLE}
-P ${CMAKE_SOURCE_DIR}/cmake/VersionHeader.cmake
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/VersionHeader.cmake
)

include(GNUInstallDirs)
Expand Down
1 change: 1 addition & 0 deletions cmake/VersionHeader.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if (GIT_EXECUTABLE)
OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT
RESULT_VARIABLE GIT_DESCRIBE_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
)
if (NOT GIT_DESCRIBE_ERROR)
# Describe output will be in the form v<version>-<commits>-g<hash>[-dirty]
Expand Down
3 changes: 1 addition & 2 deletions ionc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ target_include_directories(objlib
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../decNumber/include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}

${CMAKE_CURRENT_BINARY_DIR}/../
)

add_dependencies(objlib version)
Expand Down

0 comments on commit 1dc0e0b

Please sign in to comment.