fixed some issues caused the build system changeings

This commit is contained in:
Martchus 2016-04-16 18:32:22 +02:00
parent bd0cbd5802
commit d27520af68
3 changed files with 15 additions and 12 deletions

View File

@ -3,11 +3,14 @@
# set project name (displayed in Qt Creator) # set project name (displayed in Qt Creator)
project(${META_PROJECT_NAME}) project(${META_PROJECT_NAME})
# might be useful so other projects built as part of the same subdirs project # provide variables for other projects built as part of the same subdirs project
# can access files from this project # to access files from this project
set(${META_PROJECT_VARNAME}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE) get_directory_property(HAS_PARENT PARENT_DIRECTORY)
set(${META_PROJECT_VARNAME}_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE) if(HAS_PARENT)
set(${META_PROJECT_NAME}_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE) set(${META_PROJECT_VARNAME}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)
set(${META_PROJECT_VARNAME}_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
set(${META_PROJECT_NAME}_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
endif()
# stringify the meta data # stringify the meta data
set(META_PROJECT_NAME_STR "\"${META_PROJECT_NAME}\"") set(META_PROJECT_NAME_STR "\"${META_PROJECT_NAME}\"")

View File

@ -133,7 +133,7 @@ if(NOT TARGET install-binary-strip)
endif() endif()
# add install target for header files # add install target for header files
foreach(HEADER_FILE ${HEADER_FILES}) foreach(HEADER_FILE ${HEADER_FILES} ${ADDITIONAL_HEADER_FILES})
get_filename_component(HEADER_DIR "${HEADER_FILE}" DIRECTORY) get_filename_component(HEADER_DIR "${HEADER_FILE}" DIRECTORY)
install( install(
FILES "${HEADER_FILE}" FILES "${HEADER_FILE}"
@ -193,26 +193,26 @@ endif()
# add mingw-w64 specific install targets # add mingw-w64 specific install targets
if(NOT TARGET install-mingw-w64) if(NOT TARGET install-mingw-w64)
add_custom_target(install-mingw-w64 add_custom_target(install-mingw-w64
DEPENDS install-binary install-header DEPENDS install-binary install-header install-cmake-stuff ${LOCALIZATION_TARGET}
) )
endif() endif()
if(NOT TARGET install-mingw-w64-importlib-strip) if(NOT TARGET install-mingw-w64-importlib-strip)
add_custom_target(install-mingw-w64-importlib-strip add_custom_target(install-mingw-w64-importlib-strip
DEPENDS install-binary-strip DEPENDS install-binary-strip
COMMAND "${CMAKE_FIND_ROOT_PATH}/bin/strip" --strip-unneeded "${CMAKE_INSTALL_PREFIX}/lib/lib${META_PROJECT_NAME}.dll.a" COMMAND "${CMAKE_FIND_ROOT_PATH}/bin/strip" --strip-unneeded "\$\{DESTDIR\}\$\{DESTDIR:+/\}${CMAKE_INSTALL_PREFIX}/lib/lib${META_PROJECT_NAME}.dll.a"
) )
endif() endif()
if(NOT TARGET install-mingw-w64-staticlib-strip) if(NOT TARGET install-mingw-w64-staticlib-strip)
add_custom_target(install-mingw-w64-staticlib-strip add_custom_target(install-mingw-w64-staticlib-strip
DEPENDS install-binary-strip DEPENDS install-binary-strip
COMMAND "${CMAKE_FIND_ROOT_PATH}/bin/strip" -g "${CMAKE_INSTALL_PREFIX}/lib/lib${META_PROJECT_NAME}.a" COMMAND "${CMAKE_FIND_ROOT_PATH}/bin/strip" -g "\$\{DESTDIR\}\$\{DESTDIR:+/\}${CMAKE_INSTALL_PREFIX}/lib/lib${META_PROJECT_NAME}.a"
) )
endif() endif()
if(NOT TARGET install-mingw-w64-strip) if(NOT TARGET install-mingw-w64-strip)
add_custom_target(install-mingw-w64-strip add_custom_target(install-mingw-w64-strip
DEPENDS install-binary-strip install-mingw-w64-importlib-strip install-mingw-w64-staticlib-strip install-header DEPENDS install-binary-strip install-mingw-w64-importlib-strip install-mingw-w64-staticlib-strip install-header install-cmake-stuff ${LOCALIZATION_TARGET}
) )
endif() endif()

View File

@ -12,9 +12,9 @@ if(MINGW)
elseif(EXISTS "${CPP_UTILITIES_SOURCE_DIR}/cmake/templates/windows.rc.in") elseif(EXISTS "${CPP_UTILITIES_SOURCE_DIR}/cmake/templates/windows.rc.in")
# check sources of c++utilities # check sources of c++utilities
set(RC_TEMPLATE_FILE "${CPP_UTILITIES_SOURCE_DIR}/cmake/templates/windows.rc.in") set(RC_TEMPLATE_FILE "${CPP_UTILITIES_SOURCE_DIR}/cmake/templates/windows.rc.in")
elseif(EXISTS "${CMAKE_INSTALL_PREFIX}/share/c++utilities/cmake-templates/windows.rc.in") elseif(EXISTS "${CMAKE_INSTALL_PREFIX}/share/c++utilities/cmake/templates/windows.rc.in")
# check installed version of c++utilities # check installed version of c++utilities
set(RC_TEMPLATE_FILE "${CMAKE_INSTALL_PREFIX}/share/c++utilities/cmake-templates/windows.rc.in") set(RC_TEMPLATE_FILE "${CMAKE_INSTALL_PREFIX}/share/c++utilities/cmake/templates/windows.rc.in")
else() else()
message(FATAL_ERROR "Template for Windows *.rc file can not be located.") message(FATAL_ERROR "Template for Windows *.rc file can not be located.")
endif() endif()