cmake: try to use a unique target name for tools
This commit is contained in:
parent
bfc74cbc82
commit
164652d89a
@ -416,25 +416,6 @@ list (
|
|||||||
add_library(cruft-util ${UTIL_FILES})
|
add_library(cruft-util ${UTIL_FILES})
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
add_executable(hash tools/hash.cpp)
|
|
||||||
add_executable(json-clean tools/json-clean.cpp)
|
|
||||||
add_executable(json-schema tools/json-schema.cpp)
|
|
||||||
add_executable(json-validate tools/json-validate.cpp)
|
|
||||||
add_executable(scratch tools/scratch.cpp)
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
configure_file(libcruft-util-system.pc.in libcruft-util.pc)
|
|
||||||
configure_file(Doxyfile.in Doxyfile)
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
include(CTest)
|
|
||||||
enable_testing()
|
|
||||||
add_subdirectory(test)
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
set (LIBS "cruft-util;${LIBS}")
|
set (LIBS "cruft-util;${LIBS}")
|
||||||
|
|
||||||
@ -443,8 +424,25 @@ if (HAS_PARENT)
|
|||||||
set (CRUFT_UTIL_LIBS ${LIBS} PARENT_SCOPE)
|
set (CRUFT_UTIL_LIBS ${LIBS} PARENT_SCOPE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_link_libraries(hash ${LIBS})
|
|
||||||
target_link_libraries(json-clean ${LIBS})
|
###############################################################################
|
||||||
target_link_libraries(json-schema ${LIBS})
|
foreach (tool hash json-clean json-schema json-validate scratch)
|
||||||
target_link_libraries(json-validate ${LIBS})
|
add_executable (util_${tool} tools/${tool}.cpp)
|
||||||
target_link_libraries(scratch ${LIBS})
|
set_target_properties (util_${tool} PROPERTIES OUTPUT_NAME ${tool})
|
||||||
|
target_link_libraries (util_${tool} ${LIBS})
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
option (TESTS "enable unit testing" ON)
|
||||||
|
|
||||||
|
if (TESTS)
|
||||||
|
include(CTest)
|
||||||
|
enable_testing()
|
||||||
|
add_subdirectory(test)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
configure_file(libcruft-util-system.pc.in libcruft-util.pc)
|
||||||
|
configure_file(Doxyfile.in Doxyfile)
|
||||||
|
Loading…
Reference in New Issue
Block a user