Compare commits
No commits in common. "c2ac523d86b3fbe0c524a1eb77f2d6260ba1c360" and "c82b5f29f1c4794e6519e9556fd7389a6628b63b" have entirely different histories.
c2ac523d86
...
c82b5f29f1
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
project(myx-cmake VERSION 0.4.5 LANGUAGES)
|
project(myx-cmake VERSION 0.4.4 LANGUAGES)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake
|
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake
|
||||||
|
@ -10,15 +10,10 @@ function(myx_cmake_add_shared_library target)
|
|||||||
myx_cmake_message_error("MyxCMake: myx_cmake_add_shared_library needs target of type OBJECT_LIBRARY")
|
myx_cmake_message_error("MyxCMake: myx_cmake_add_shared_library needs target of type OBJECT_LIBRARY")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
get_target_property(__output_name ${target} OUTPUT_NAME)
|
|
||||||
if(NOT __output_name)
|
|
||||||
set(__output_name ${target})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(${target}-shared SHARED $<TARGET_OBJECTS:${target}>)
|
add_library(${target}-shared SHARED $<TARGET_OBJECTS:${target}>)
|
||||||
# cmake-format: off
|
set_target_properties(
|
||||||
set_target_properties(${target}-shared
|
${target}-shared
|
||||||
PROPERTIES OUTPUT_NAME ${__output_name}
|
PROPERTIES OUTPUT_NAME ${target}
|
||||||
VERSION ${PROJECT_VERSION}
|
VERSION ${PROJECT_VERSION}
|
||||||
SOVERSION ${PROJECT_VERSION_MAJOR}
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||||
LIBRARY_OUTPUT_DIRECTORY
|
LIBRARY_OUTPUT_DIRECTORY
|
||||||
@ -26,5 +21,4 @@ function(myx_cmake_add_shared_library target)
|
|||||||
install(TARGETS ${target}-shared
|
install(TARGETS ${target}-shared
|
||||||
COMPONENT main
|
COMPONENT main
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
# cmake-format: on
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -10,18 +10,13 @@ function(myx_cmake_add_static_library target)
|
|||||||
myx_cmake_message_error("MyxCMake: myx_cmake_add_static_library needs target of type OBJECT_LIBRARY")
|
myx_cmake_message_error("MyxCMake: myx_cmake_add_static_library needs target of type OBJECT_LIBRARY")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
get_target_property(__output_name ${target} OUTPUT_NAME)
|
|
||||||
if(NOT __output_name)
|
|
||||||
set(__output_name ${target})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(${target}-static STATIC $<TARGET_OBJECTS:${target}>)
|
add_library(${target}-static STATIC $<TARGET_OBJECTS:${target}>)
|
||||||
# cmake-format: off
|
|
||||||
set_target_properties(${target}-static
|
set_target_properties(${target}-static
|
||||||
PROPERTIES OUTPUT_NAME ${__output_name}
|
PROPERTIES
|
||||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
OUTPUT_NAME ${target}
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||||
install(TARGETS ${target}-static
|
install(TARGETS ${target}-static
|
||||||
COMPONENT static
|
COMPONENT static
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
# cmake-format: on
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -54,23 +54,23 @@ function(myx_cmake_format_sources target)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(EXISTS ${CMAKE_SOURCE_DIR}/.uncrustify.cfg)
|
if(EXISTS ${CMAKE_SOURCE_DIR}/.uncrustify.cfg)
|
||||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/uncrustify-${target}.cfg
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/uncrustify.cfg
|
||||||
COMMAND ${UNCRUSTIFY_EXE} --update-config-with-doc
|
COMMAND ${UNCRUSTIFY_EXE} --update-config-with-doc
|
||||||
-c ${CMAKE_SOURCE_DIR}/.uncrustify.cfg
|
-c ${CMAKE_SOURCE_DIR}/.uncrustify.cfg
|
||||||
-o ${CMAKE_BINARY_DIR}/uncrustify-${target}.cfg)
|
-o ${CMAKE_BINARY_DIR}/uncrustify.cfg)
|
||||||
list(APPEND UNCRUSTIFY_OPTS -c ${CMAKE_BINARY_DIR}/uncrustify-${target}.cfg)
|
list(APPEND UNCRUSTIFY_OPTS -c ${CMAKE_BINARY_DIR}/uncrustify.cfg)
|
||||||
endif()
|
endif()
|
||||||
# cmake-format: off
|
# cmake-format: off
|
||||||
add_custom_target(${target}-format-sources-check-uncrustify
|
add_custom_target(${target}-format-sources-check-uncrustify
|
||||||
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify-${target}.cfg
|
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg
|
||||||
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --check ${__sources})
|
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --check ${__sources})
|
||||||
list(APPEND UNCRUSTIFY_OPTS --replace --no-backup)
|
list(APPEND UNCRUSTIFY_OPTS --replace --no-backup)
|
||||||
add_custom_target(${target}-format-sources-uncrustify
|
add_custom_target(${target}-format-sources-uncrustify
|
||||||
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify-${target}.cfg
|
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg
|
||||||
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --mtime ${__sources})
|
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --mtime ${__sources})
|
||||||
|
|
||||||
add_custom_target(${target}-doc-doxygen-append-comments
|
add_custom_target(${target}-doc-doxygen-append-comments
|
||||||
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify-${target}.cfg
|
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg
|
||||||
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS}
|
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS}
|
||||||
--set cmt_insert_class_header=uncrustify-classheader.txt
|
--set cmt_insert_class_header=uncrustify-classheader.txt
|
||||||
--set cmt_insert_file_footer=uncrustify-filefooter.txt
|
--set cmt_insert_file_footer=uncrustify-filefooter.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user