4 add_library(${name} ${_srcs})
6 APPEND PROPERTY COMPILE_DEFINITIONS US_MODULE_NAME=${name})
7 set_property(
TARGET ${name} PROPERTY US_MODULE_NAME ${name})
8 if(NOT US_BUILD_SHARED_LIBS OR NOT BUILD_SHARED_LIBS)
9 set_property(
TARGET ${name} APPEND PROPERTY COMPILE_DEFINITIONS US_STATIC_MODULE)
11 if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
12 get_property(_compile_flags
TARGET ${name} PROPERTY COMPILE_FLAGS)
13 set_property(
TARGET ${name} PROPERTY COMPILE_FLAGS
"${_compile_flags} -fPIC")
16 target_link_libraries(${name} ${${PROJECT_NAME}_TARGET} ${US_TEST_LINK_LIBRARIES} ${US_LINK_LIBRARIES})
18 if(_res_files OR US_TEST_LINK_LIBRARIES)
21 ZIP_ARCHIVES ${US_TEST_LINK_LIBRARIES})
25 FILES ${_bin_res_files})
30 if(NOT US_TEST_SKIP_MODULE_LIST)
31 set(_us_test_module_libs
"${_us_test_module_libs};${name}" CACHE INTERNAL
"" FORCE)
45 cmake_parse_arguments(US_TEST "SKIP_MODULE_LIST;LINK_RESOURCES;APPEND_RESOURCES" "RESOURCES_ROOT" "SOURCES;RESOURCES;BINARY_RESOURCES;LINK_LIBRARIES" "" ${ARGN})
48 if(US_TEST_LINK_RESOURCES)
50 elseif(US_TEST_APPEND_RESOURCES)
54 set(_srcs ${US_TEST_SOURCES})
56 set(_res_files ${US_TEST_RESOURCES})
57 set(_bin_res_files ${US_TEST_BINARY_RESOURCES})
58 if(US_TEST_RESOURCES_ROOT)
59 set(_res_root ${US_TEST_RESOURCES_ROOT})
61 set(_res_root ${CMAKE_CURRENT_SOURCE_DIR}/resources)
_us_create_test_module_helper()
usFunctionAddResources()
Add resources to a library or executable.
usFunctionCreateTestModuleWithResources(name)
usFunctionEmbedResources()
Embed resources in a library or executable.
usFunctionCreateTestModule(name)
usFunctionGetResourceSource()
Get a source file name for handling resource dependencies.
usFunctionGenerateModuleInit(src_var)
Generate a source file which handles proper initialization of a module.