Commit 4bb5749c authored by Martin Heistermann's avatar Martin Heistermann Committed by Jan Möbius
Browse files

Fix issue OpenFlipper-Free#176, Qt UIC include directories.

Single configuration generators on Windows (e.g. nmake) didn't get the
correct include path for autogenerated headers from .ui files.

Multi-configuration generators (e.g. MSVC) only worked in an incomplete
subset of build types.

While AUTOUIC automatically sets include directories for the target,
these only seem to be PRIVATE include dirs, leading to failure when
trying to use them from other projects than where the .ui file lives.
parent f0e55a67
......@@ -48,15 +48,16 @@ acg_add_library ( ${TYPENAME} SHARED ${sources} ${headers})
set_target_properties ( ${TYPENAME} PROPERTIES MACOSX_RPATH 0 )
if ( NOT WIN32 )
# Allow targets depending on ACG find the autogenerated header files
# Allow targets depending on the current type find the autogenerated header files from uic
# cf OpenFlipper/libs_required/ACG/CMakeLists.txt
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if ( _isMultiConfig )
target_include_directories( ${TYPENAME} PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${TYPENAME}_autogen/include )
${CMAKE_CURRENT_BINARY_DIR}/${TYPENAME}_autogen/include_$<CONFIG>/)
else()
# Allow targets depending on the current type find the autogenerated header files from uic
target_include_directories( ${TYPENAME} PUBLIC
$<$<CONFIG:Debug>:${CMAKE_CURRENT_BINARY_DIR}/${TYPENAME}_autogen/include_Debug/>
$<$<CONFIG:Release>:${CMAKE_CURRENT_BINARY_DIR}/${TYPENAME}_autogen/include_Release/> )
${CMAKE_CURRENT_BINARY_DIR}/${TYPENAME}_autogen/include )
endif()
......
......@@ -112,17 +112,24 @@ endif ()
# display results
acg_print_configure_header (ACG "ACG")
if ( NOT WIN32 )
# Allow targets depending on ACG find the autogenerated header files
# Allow targets depending on ACG find the autogenerated header files
# cf OpenFlipper/cmake/type.cmake
# cf https://www.graphics.rwth-aachen.de:9000/OpenFlipper-Free/OpenFlipper-Free/-/issues/176
# CMake's AUTOUIC automatically adds the proper include path to the target, however
# we need a PUBLIC include directory - so we do this manually for now:
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if ( _isMultiConfig )
target_include_directories( ACG PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/ACG_autogen/include )
${CMAKE_CURRENT_BINARY_DIR}/ACG_autogen/include_$<CONFIG>/)
else()
# Allow targets depending on ACG find the autogenerated header files
target_include_directories( ACG PUBLIC
$<$<CONFIG:Debug>:${CMAKE_CURRENT_BINARY_DIR}/ACG_autogen/include_Debug/>
$<$<CONFIG:Release>:${CMAKE_CURRENT_BINARY_DIR}/ACG_autogen/include_Release/> )
${CMAKE_CURRENT_BINARY_DIR}/ACG_autogen/include )
endif()
target_link_libraries ( ACG ${OPENMESH_LIBRARIES}
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment