diff --git a/rdtk/CMakeLists.txt b/rdtk/CMakeLists.txt index f219eb2fb..291b8bfea 100644 --- a/rdtk/CMakeLists.txt +++ b/rdtk/CMakeLists.txt @@ -96,11 +96,11 @@ endif() SetFreeRDPCMakeInstallDir(RDTK_CMAKE_INSTALL_DIR "rdtk${RDTK_VERSION_MAJOR}") -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/templates) +set(RDTK_INCLUDE_DIR include/rdtk${RDTK_API_VERSION}) add_subdirectory(librdtk) -add_subdirectory(include) add_subdirectory(templates) +add_subdirectory(include) install(EXPORT rdtk DESTINATION ${RDTK_CMAKE_INSTALL_DIR}) diff --git a/rdtk/include/CMakeLists.txt b/rdtk/include/CMakeLists.txt index 774fe0b0e..086e59158 100644 --- a/rdtk/include/CMakeLists.txt +++ b/rdtk/include/CMakeLists.txt @@ -1,2 +1,8 @@ -file(GLOB RDTK_HEADERS "rdtk/*.h") -install(FILES ${RDTK_HEADERS} DESTINATION include/rdtk${RDTK_API_VERSION}/rdtk COMPONENT headers) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + DESTINATION ${RDTK_INCLUDE_DIR} + FILES_MATCHING PATTERN "*.h") + +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ + DESTINATION ${RDTK_INCLUDE_DIR} + FILES_MATCHING PATTERN "*.h") + diff --git a/rdtk/librdtk/rdtk_button.c b/rdtk/librdtk/rdtk_button.c index a33c5eafa..db7bbf86d 100644 --- a/rdtk/librdtk/rdtk_button.c +++ b/rdtk/librdtk/rdtk_button.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include "rdtk_font.h" diff --git a/rdtk/librdtk/rdtk_engine.c b/rdtk/librdtk/rdtk_engine.c index 5c20e3f5b..41aad72f6 100644 --- a/rdtk/librdtk/rdtk_engine.c +++ b/rdtk/librdtk/rdtk_engine.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include "rdtk_font.h" #include "rdtk_nine_patch.h" diff --git a/rdtk/librdtk/rdtk_font.c b/rdtk/librdtk/rdtk_font.c index c0b548a09..702f62b6f 100644 --- a/rdtk/librdtk/rdtk_font.c +++ b/rdtk/librdtk/rdtk_font.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include diff --git a/rdtk/librdtk/rdtk_label.c b/rdtk/librdtk/rdtk_label.c index fb79f9a6e..851beaefd 100644 --- a/rdtk/librdtk/rdtk_label.c +++ b/rdtk/librdtk/rdtk_label.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include "rdtk_font.h" diff --git a/rdtk/librdtk/rdtk_nine_patch.c b/rdtk/librdtk/rdtk_nine_patch.c index fae43250d..04ccfe329 100644 --- a/rdtk/librdtk/rdtk_nine_patch.c +++ b/rdtk/librdtk/rdtk_nine_patch.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include "rdtk_resources.h" diff --git a/rdtk/librdtk/rdtk_resources.c b/rdtk/librdtk/rdtk_resources.c index 169bdbf35..35bb7e78f 100644 --- a/rdtk/librdtk/rdtk_resources.c +++ b/rdtk/librdtk/rdtk_resources.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include #include diff --git a/rdtk/librdtk/rdtk_surface.c b/rdtk/librdtk/rdtk_surface.c index d6a247fbd..706a07c5d 100644 --- a/rdtk/librdtk/rdtk_surface.c +++ b/rdtk/librdtk/rdtk_surface.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include "rdtk_surface.h" diff --git a/rdtk/librdtk/rdtk_text_field.c b/rdtk/librdtk/rdtk_text_field.c index f0d0f5af3..7b589cc92 100644 --- a/rdtk/librdtk/rdtk_text_field.c +++ b/rdtk/librdtk/rdtk_text_field.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include "rdtk_font.h" diff --git a/rdtk/sample/rdtk_x11.c b/rdtk/sample/rdtk_x11.c index 01ddb4136..d0bcba759 100644 --- a/rdtk/sample/rdtk_x11.c +++ b/rdtk/sample/rdtk_x11.c @@ -16,9 +16,7 @@ * limitations under the License. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include #include diff --git a/rdtk/templates/CMakeLists.txt b/rdtk/templates/CMakeLists.txt index 172e2f2d2..c15da76b0 100644 --- a/rdtk/templates/CMakeLists.txt +++ b/rdtk/templates/CMakeLists.txt @@ -1,8 +1,6 @@ include (SetFreeRDPCMakeInstallDir) -set(RDTK_INCLUDE_DIR "include/rdtk${RDTK_VERSION_MAJOR}") - # cmake package export(PACKAGE rdtk) @@ -24,22 +22,22 @@ FOREACH(var ${res}) LIST(APPEND RDTK_BUILD_CONFIG_LIST "${var}=${${var}}") ENDIF() ENDFOREACH() + string(REPLACE ";" " " RDTK_BUILD_CONFIG "${RDTK_BUILD_CONFIG_LIST}") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/buildflags.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/build-config.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/rdtk/version.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/rdtk/buildflags.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/rdtk/build-config.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/rdtk/config.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rdtk.pc.in ${CMAKE_CURRENT_BINARY_DIR}/rdtk${RDTK_VERSION_MAJOR}.pc @ONLY) -set(RDTK_INSTALL_INCLUDE_DIR include/rdtk${RDTK_API_VERSION}/rdtk) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.h DESTINATION ${RDTK_INSTALL_INCLUDE_DIR} COMPONENT headers) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION ${RDTK_INSTALL_INCLUDE_DIR} COMPONENT headers) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/build-config.h DESTINATION ${RDTK_INSTALL_INCLUDE_DIR} COMPONENT headers) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/buildflags.h DESTINATION ${RDTK_INSTALL_INCLUDE_DIR} COMPONENT headers) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rdtk${RDTK_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +set(RDTK_INSTALL_INCLUDE_DIR ${RDTK_INCLUDE_DIR}/rdtk) install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/rdtkConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/rdtkConfigVersion.cmake + ${CMAKE_CURRENT_BINARY_DIR}/rdtk${RDTK_VERSION_MAJOR}.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/rdtkConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/rdtkConfigVersion.cmake DESTINATION ${RDTK_CMAKE_INSTALL_DIR})