Commit 2cb547d7 authored by schultezub's avatar schultezub
Browse files

updated make files:

 * fixed DLLs being copied to source folder instead of binary folder
 * added Qt4 DLLs to be copied (usefull when having multiple versions of Qt installed)

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@357 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 119b6ea1
......@@ -58,21 +58,15 @@ ENDIF()
# Copy External DLLs
#
IF(WIN32)
# gather Qt4 DLLs - TODO: remove redundant naming of required components
FIND_PACKAGE(Qt4DLLs COMPONENTS QtCore QtGui QtOpenGL)
LIST(APPEND CampvisExternalDllsDebug ${QT_DEBUG_DLLS})
LIST(APPEND CampvisExternalDllsRelease ${QT_RELEASE_DLLS})
LIST(REMOVE_DUPLICATES CampvisExternalDllsDebug)
LIST(REMOVE_DUPLICATES CampvisExternalDllsRelease)
IF(CAMPVIS_COPY_EXTERNAL_DLLS)
COPY_EXTERNAL_DLLS(CampvisExternalDllsDebug CampvisExternalDllsRelease false)
ENDIF()
IF(CAMPVIS_ADD_INSTALL_TARGET)
INSTALL(FILES ${CampvisExternalDllsDebug}
DESTINATION .
CONFIGURATIONS Debug
)
INSTALL(FILES ${CampvisExternalDllsRelease}
DESTINATION .
CONFIGURATIONS Release
)
ENDIF()
ENDIF()
......@@ -20,7 +20,7 @@ ENDIF()
IF(DLL_DIR)
SET(QT_DLLS_FOUND TRUE)
FOREACH(component ${Qt4DLLsCAMPVIS_FIND_COMPONENTS})
FOREACH(component ${Qt4DLLs_FIND_COMPONENTS})
IF(EXISTS ${DLL_DIR}/${component}d4.dll)
LIST(APPEND QT_DEBUG_DLLS ${DLL_DIR}/${component}d4.dll)
ELSE()
......
IF(NOT CommonconfProcessed)
SET(CampvisHome ${CMAKE_CURRENT_SOURCE_DIR})
MESSAGE(STATUS "TUMVis Home: ${CampvisHome}")
MESSAGE(STATUS "TUMVis Source Directory: ${CampvisHome}")
MESSAGE(STATUS "TUMVis Binary Directory: ${CMAKE_BINARY_DIR}")
# include macros
INCLUDE(${CampvisHome}/cmake/macros.cmake)
......@@ -53,9 +54,9 @@ ENDIF()
# set binary output path
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CampvisHome}/bin")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CampvisHome}/bin")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CampvisHome}/bin")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# common include directories
LIST(APPEND CampvisGlobalIncludeDirs "${CampvisHome}/ext")
......@@ -205,7 +206,6 @@ FOREACH(ModDir ${ModDirs})
# check whether module.cmake file exists
SET(ModFile ${ModulesDir}/${ModDir}/${ModDir}.cmake)
IF(EXISTS ${ModFile})
MESSAGE(STATUS "* Found Module ${ModDir}")
STRING(TOLOWER ${ModDir} ModDirLower)
STRING(TOUPPER ${ModDir} ModDirUpper)
......@@ -230,10 +230,15 @@ FOREACH(ModDir ${ModDirs})
UNSET(ThisModSources)
UNSET(ThisModHeaders)
ELSEIF(NOT DEFINED CAMPVIS_BUILD_MODULE_${ModDirUpper})
MESSAGE(STATUS "* Found Module '${ModDir}' . ENABLED")
ELSE()
MESSAGE(STATUS "* Found Module '${ModDir}'")
ENDIF(CAMPVIS_BUILD_MODULE_${ModDirUpper})
IF(NOT DEFINED CAMPVIS_BUILD_MODULE_${ModDirUpper})
# add a CMake option for building this module
OPTION(CAMPVIS_BUILD_MODULE_${ModDirUpper} "Build Module ${ModDir}" OFF)
ENDIF(CAMPVIS_BUILD_MODULE_${ModDirUpper})
ENDIF(NOT DEFINED CAMPVIS_BUILD_MODULE_${ModDirUpper})
ELSE(EXISTS ${ModFile})
MESSAGE(STATUS "* WARNING: Found Directory ${ModDir} Without CMake file - ignored")
......@@ -243,4 +248,3 @@ ENDFOREACH(ModDir ${ModDirs})
SET(CommonconfProcessed TRUE)
ENDIF(NOT CommonconfProcessed)
\ No newline at end of file
......@@ -18,7 +18,7 @@ ENDMACRO(LIST_SUBDIRECTORIES)
MACRO(COPY_EXTERNAL_DLLS DebugDLLs ReleaseDLLs failOnError)
MESSAGE(STATUS "Copying external DLLs")
SET(debug_dir "${CampvisHome}/bin/Debug")
SET(debug_dir "${CMAKE_BINARY_DIR}/bin/Debug")
IF(NOT EXISTS ${debug_dir})
FILE(MAKE_DIRECTORY ${debug_dir})
ENDIF()
......@@ -36,7 +36,7 @@ MACRO(COPY_EXTERNAL_DLLS DebugDLLs ReleaseDLLs failOnError)
ENDIF()
ENDFOREACH()
SET(release_dir "${CampvisHome}/bin/Release")
SET(release_dir "${CMAKE_BINARY_DIR}/bin/Release")
IF(NOT EXISTS ${release_dir})
FILE(MAKE_DIRECTORY ${release_dir})
ENDIF()
......@@ -64,13 +64,13 @@ MACRO(ADD_COPY_DLL_COMMAND Target DebugDLLs ReleaseDLLs)
MESSAGE(${dll})
ADD_CUSTOM_COMMAND(
TARGET ${Target}
COMMAND ${CMAKE_COMMAND} -E copy ${dll} ${CampvisHome}/bin/Debug
COMMAND ${CMAKE_COMMAND} -E copy ${dll} ${CMAKE_BINARY_DIR}/bin/Debug
)
ENDFOREACH()
FOREACH(dll ${${ReleaseDLLs}})
ADD_CUSTOM_COMMAND(
TARGET ${Target}
COMMAND ${CMAKE_COMMAND} -E copy ${dll} ${CampvisHome}/bin/Release
COMMAND ${CMAKE_COMMAND} -E copy ${dll} ${CMAKE_BINARY_DIR}/bin/Release
)
ENDFOREACH()
ENDMACRO(ADD_COPY_DLL_COMMAND)
......
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