68 lines
2.0 KiB
CMake
Executable File
68 lines
2.0 KiB
CMake
Executable File
#
|
|
# CMake Script für ngltools
|
|
# $Id$
|
|
# $HeadURL$
|
|
# $Author$
|
|
#
|
|
|
|
SET(ngltools_SRCS
|
|
ngltools_bitset.h
|
|
ngltools_convert.cpp
|
|
ngltools_convert.h
|
|
ngltools_dtg.cpp
|
|
ngltools_dtg.h
|
|
ngltools_export.h
|
|
ngltools_filesystem.cpp
|
|
ngltools_filesystem.h
|
|
ngltools_helpevent.cpp
|
|
ngltools_helpevent.h
|
|
)
|
|
|
|
NGL_ADD_LIBRARY2(ALL ngltools SHARED ${ngltools_SRCS})
|
|
NGL_TARGET_LINK_LIBRARIES(ngltools
|
|
PUBLIC
|
|
Qt6::Core
|
|
)
|
|
|
|
# Smoke test for ngltools DTG conversion utilities
|
|
IF(BUILD_TESTING)
|
|
# Check if Qt6::Test already exists from parent CMakeLists.txt
|
|
if(TARGET Qt6::Test)
|
|
set(_QTTEST_TARGET Qt6::Test)
|
|
set(_QTCORE_TARGET Qt6::Core)
|
|
else()
|
|
find_package(Qt6 COMPONENTS Test Core QUIET)
|
|
if (Qt6_FOUND)
|
|
set(_QTTEST_TARGET Qt6::Test)
|
|
set(_QTCORE_TARGET Qt6::Core)
|
|
else()
|
|
find_package(Qt6 COMPONENTS Test Core REQUIRED)
|
|
set(_QTTEST_TARGET Qt6::Test)
|
|
set(_QTCORE_TARGET Qt6::Core)
|
|
endif()
|
|
endif()
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/NGLToolsQtSmokeTest.cpp)
|
|
if(TARGET ngltools)
|
|
add_executable(ngltools_qt_smoke tests/NGLToolsQtSmokeTest.cpp)
|
|
target_link_libraries(ngltools_qt_smoke PRIVATE ngltools ${_QTTEST_TARGET} ${_QTCORE_TARGET})
|
|
else()
|
|
# Build the smoke test as a standalone executable using the dtg implementation
|
|
# when the ngltools library target is not available in this configuration.
|
|
add_executable(ngltools_qt_smoke tests/NGLToolsQtSmokeTest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ngltools_dtg.cpp)
|
|
target_include_directories(ngltools_qt_smoke PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
target_link_libraries(ngltools_qt_smoke PRIVATE ${_QTTEST_TARGET} ${_QTCORE_TARGET})
|
|
endif()
|
|
add_test(NAME NGLToolsQtSmoke COMMAND ngltools_qt_smoke)
|
|
endif()
|
|
ENDIF()
|
|
NGL_TARGET_COMPILE_DEFINITIONS(ngltools PUBLIC BUILD_BASE_PATH="${CMAKE_BINARY_DIR}")
|
|
NGL_TARGET_COMPILE_DEFINITIONS(ngltools PUBLIC INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
|
|
|
|
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(ngltools
|
|
INTERFACE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../
|
|
)
|
|
NGL_INSTALL_TARGET(ngltools)
|