mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-30 23:05:23 -04:00
Add ZINT_SHARED CMake option
Either shared or static (or both) libraries can be built now. Executables (zint and zint-qt) are linked with the static library if the shared library it not built.
This commit is contained in:
parent
2f8681b21a
commit
66431d8ec1
8 changed files with 53 additions and 18 deletions
|
@ -5,10 +5,12 @@
|
|||
|
||||
macro(zint_add_test test_name test_command)
|
||||
set(ADDITIONAL_LIBS "${ARGN}" ${LIBRARY_FLAGS})
|
||||
add_executable(${test_command} ${test_command}.c)
|
||||
target_link_libraries(${test_command} testcommon ${ADDITIONAL_LIBS})
|
||||
add_test(${test_name} ${test_command})
|
||||
set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
if(ZINT_SHARED)
|
||||
add_executable(${test_command} ${test_command}.c)
|
||||
target_link_libraries(${test_command} testcommon ${ADDITIONAL_LIBS})
|
||||
add_test(${test_name} ${test_command})
|
||||
set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
endif()
|
||||
if(ZINT_STATIC)
|
||||
add_executable(${test_command}-static ${test_command}.c)
|
||||
target_link_libraries(${test_command}-static testcommon-static ${ADDITIONAL_LIBS})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue