Commit a7c794d6 authored by David Bommes's avatar David Bommes
Browse files

fixed mac build stuff

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@195 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 69384731
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (factored_solver WIN32 ${sources} ${headers} ) acg_add_executable (factored_solver WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (factored_solver MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (factored_solver ${sources} ${headers} ) acg_add_executable (factored_solver ${sources} ${headers} )
endif () endif ()
...@@ -29,15 +26,3 @@ target_link_libraries (factored_solver ...@@ -29,15 +26,3 @@ target_link_libraries (factored_solver
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
factored_solver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo factored_solver"
)
endif ()
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (quadratic_solver WIN32 ${sources} ${headers} ) acg_add_executable (quadratic_solver WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (quadratic_solver MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (quadratic_solver ${sources} ${headers} ) acg_add_executable (quadratic_solver ${sources} ${headers} )
endif () endif ()
...@@ -29,14 +26,3 @@ target_link_libraries (quadratic_solver ...@@ -29,14 +26,3 @@ target_link_libraries (quadratic_solver
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
quadratic_solver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo quadratic_solver"
)
endif ()
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (small_eigenproblem WIN32 ${sources} ${headers} ) acg_add_executable (small_eigenproblem WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (small_eigenproblem MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (small_eigenproblem ${sources} ${headers} ) acg_add_executable (small_eigenproblem ${sources} ${headers} )
endif () endif ()
...@@ -28,15 +25,4 @@ set_target_properties(small_eigenproblem PROPERTIES INSTALL_RPATH_USE_LINK_PATH ...@@ -28,15 +25,4 @@ set_target_properties(small_eigenproblem PROPERTIES INSTALL_RPATH_USE_LINK_PATH
target_link_libraries (small_eigenproblem target_link_libraries (small_eigenproblem
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
\ No newline at end of file
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
small_eigenproblem PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo eigenproblem"
)
endif ()
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (small_factored_solver WIN32 ${sources} ${headers} ) acg_add_executable (small_factored_solver WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (small_factored_solver MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (small_factored_solver ${sources} ${headers} ) acg_add_executable (small_factored_solver ${sources} ${headers} )
endif () endif ()
...@@ -29,14 +26,3 @@ target_link_libraries (small_factored_solver ...@@ -29,14 +26,3 @@ target_link_libraries (small_factored_solver
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
small_factored_solver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo small_factored_solver"
)
endif ()
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (small_miqp WIN32 ${sources} ${headers} ) acg_add_executable (small_miqp WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (small_miqp MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (small_miqp ${sources} ${headers} ) acg_add_executable (small_miqp ${sources} ${headers} )
endif () endif ()
...@@ -28,15 +25,4 @@ set_target_properties(small_miqp PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1) ...@@ -28,15 +25,4 @@ set_target_properties(small_miqp PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1)
target_link_libraries (small_miqp target_link_libraries (small_miqp
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
\ No newline at end of file
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
small_miqp PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo small_miqp"
)
endif ()
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (small_nleast_squares WIN32 ${sources} ${headers} ) acg_add_executable (small_nleast_squares WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (small_nleast_squares MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (small_nleast_squares ${sources} ${headers} ) acg_add_executable (small_nleast_squares ${sources} ${headers} )
endif () endif ()
...@@ -28,15 +25,4 @@ set_target_properties(small_nleast_squares PROPERTIES INSTALL_RPATH_USE_LINK_PAT ...@@ -28,15 +25,4 @@ set_target_properties(small_nleast_squares PROPERTIES INSTALL_RPATH_USE_LINK_PAT
target_link_libraries (small_nleast_squares target_link_libraries (small_nleast_squares
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
\ No newline at end of file
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
small_nsolver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo small_nleast_squares"
)
endif ()
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (small_nsolver WIN32 ${sources} ${headers} ) acg_add_executable (small_nsolver WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (small_nsolver MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (small_nsolver ${sources} ${headers} ) acg_add_executable (small_nsolver ${sources} ${headers} )
endif () endif ()
...@@ -28,15 +25,4 @@ set_target_properties(small_nsolver PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1) ...@@ -28,15 +25,4 @@ set_target_properties(small_nsolver PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1)
target_link_libraries (small_nsolver target_link_libraries (small_nsolver
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
\ No newline at end of file
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
small_nsolver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo small_nleast_squares"
)
endif ()
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (small_quadratic_solver WIN32 ${sources} ${headers} ) acg_add_executable (small_quadratic_solver WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (small_quadratic_solver MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (small_quadratic_solver ${sources} ${headers} ) acg_add_executable (small_quadratic_solver ${sources} ${headers} )
endif () endif ()
...@@ -28,15 +25,4 @@ set_target_properties(small_quadratic_solver PROPERTIES INSTALL_RPATH_USE_LINK_P ...@@ -28,15 +25,4 @@ set_target_properties(small_quadratic_solver PROPERTIES INSTALL_RPATH_USE_LINK_P
target_link_libraries (small_quadratic_solver target_link_libraries (small_quadratic_solver
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
\ No newline at end of file
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
small_quadratic_solver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo small_quadratic_solver"
)
endif ()
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (small_quadratic_resolve WIN32 ${sources} ${headers} ) acg_add_executable (small_quadratic_resolve WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (small_quadratic_resolve MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (small_quadratic_resolve ${sources} ${headers} ) acg_add_executable (small_quadratic_resolve ${sources} ${headers} )
endif () endif ()
...@@ -28,15 +25,4 @@ set_target_properties(small_quadratic_resolve PROPERTIES INSTALL_RPATH_USE_LINK_ ...@@ -28,15 +25,4 @@ set_target_properties(small_quadratic_resolve PROPERTIES INSTALL_RPATH_USE_LINK_
target_link_libraries (small_quadratic_resolve target_link_libraries (small_quadratic_resolve
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
\ No newline at end of file
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
small_quadratic_solver PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo small_quadratic_resolve"
)
endif ()
...@@ -15,9 +15,6 @@ acg_drop_templates (sources) ...@@ -15,9 +15,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (small_sparseqr WIN32 ${sources} ${headers} ) acg_add_executable (small_sparseqr WIN32 ${sources} ${headers} )
elseif (APPLE)
# generate bundle on mac
acg_add_executable (small_sparseqr MACOSX_BUNDLE ${sources} ${headers} )
else () else ()
acg_add_executable (small_sparseqr ${sources} ${headers} ) acg_add_executable (small_sparseqr ${sources} ${headers} )
endif () endif ()
...@@ -28,15 +25,4 @@ set_target_properties(small_sparseqr PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1) ...@@ -28,15 +25,4 @@ set_target_properties(small_sparseqr PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1)
target_link_libraries (small_sparseqr target_link_libraries (small_sparseqr
CoMISo CoMISo
${COMISO_LINK_LIBRARIES} ${COMISO_LINK_LIBRARIES}
) )
\ No newline at end of file
if (APPLE)
# create bundle in "Build" directory and set icon
# no install needed here, because the whole bundle will be installed in the
# toplevel CMakeLists.txt
set_target_properties (
small_sparseqr PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
MACOSX_BUNDLE_INFO_STRING "CoMISo small_sparseqr"
)
endif ()
...@@ -3,10 +3,20 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.cmake) ...@@ -3,10 +3,20 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.cmake)
endif () endif ()
# prevent build in source directory # prevent build in source directory
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
message (SEND_ERROR "Building in the source directory is not supported.") # add option to disable plugin build
message (FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} <path to the sources>\".") option (
endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") BLOCK_IN_SOURCE_BUILD
"Disable building inside the source tree"
ON
)
if ( BLOCK_IN_SOURCE_BUILD )
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
message (SEND_ERROR "Building in the source directory is not supported.")
message (FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} <path to the sources>\".")
endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
endif()
# allow only Debug and Release builds # allow only Debug and Release builds
set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
...@@ -24,6 +34,13 @@ if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build) ...@@ -24,6 +34,13 @@ if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build)
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build) file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build)
endif () endif ()
#generate the global doc target (but only once!)
GET_TARGET_PROPERTY(target_location doc EchoString)
if ( NOT target_location STREQUAL "Building Documentation" )
ADD_CUSTOM_TARGET( doc )
SET_TARGET_PROPERTIES( doc PROPERTIES EchoString "Building Documentation" )
endif()
# read version from file # read version from file
macro (acg_get_version) macro (acg_get_version)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}/VERSION") if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}/VERSION")
...@@ -81,6 +98,15 @@ else () ...@@ -81,6 +98,15 @@ else ()
set (ACG_PROJECT_BINDIR "bin") set (ACG_PROJECT_BINDIR "bin")
endif () endif ()
if( NOT APPLE )
# check 64 bit
if( CMAKE_SIZEOF_VOID_P MATCHES 4 )
set( HAVE_64_BIT 0 )
else( CMAKE_SIZEOF_VOID_P MATCHES 4 )
set( HAVE_64_BIT 1 )
endif( CMAKE_SIZEOF_VOID_P MATCHES 4 )
endif ( NOT APPLE )
# allow a project to modify the directories # allow a project to modify the directories
if (COMMAND acg_modify_project_dirs) if (COMMAND acg_modify_project_dirs)
acg_modify_project_dirs () acg_modify_project_dirs ()
...@@ -107,6 +133,7 @@ macro (acg_set_target_props target) ...@@ -107,6 +133,7 @@ macro (acg_set_target_props target)
SKIP_BUILD_RPATH 0 SKIP_BUILD_RPATH 0
) )
elseif (NOT APPLE) elseif (NOT APPLE)
set_target_properties ( set_target_properties (
${target} PROPERTIES ${target} PROPERTIES
INSTALL_RPATH "$ORIGIN/../lib/${CMAKE_PROJECT_NAME}" INSTALL_RPATH "$ORIGIN/../lib/${CMAKE_PROJECT_NAME}"
...@@ -115,6 +142,33 @@ macro (acg_set_target_props target) ...@@ -115,6 +142,33 @@ macro (acg_set_target_props target)
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}"
) )
# prepare for cross compiling
if ( HAVE_64_BIT )
if ( NOT CROSS_COMPILE_32)
# Already in cache, be silent
set( CROSS_COMPILE_32 false CACHE BOOL "Compile for 32-bit architecture")
endif( NOT CROSS_COMPILE_32 )
if ( CROSS_COMPILE_32 )
add_definitions( -m32 )
set_target_properties( ${target} PROPERTIES LINK_FLAGS -m32 )
endif ( CROSS_COMPILE_32 )
else ( HAVE_64_BIT )
if ( NOT CROSS_COMPILE_64)
# Already in cache, be silent
set( CROSS_COMPILE_64 false CACHE BOOL "Compile for 64-bit architecture")
endif( NOT CROSS_COMPILE_64 )
if ( CROSS_COMPILE_64 )
add_definitions( -m64 )
set_target_properties( ${target} PROPERTIES LINK_FLAGS -m64 )
endif ( CROSS_COMPILE_64 )
endif( HAVE_64_BIT )
endif () endif ()
endmacro () endmacro ()
...@@ -127,17 +181,25 @@ add_definitions (-DINCLUDE_TEMPLATES) ...@@ -127,17 +181,25 @@ add_definitions (-DINCLUDE_TEMPLATES)
# look for selected qt dependencies # look for selected qt dependencies
macro (acg_qt4) macro (acg_qt4)
if (NOT QT4_FOUND) if (NOT QT4_FOUND)
find_package (Qt4 COMPONENTS QtCore QtGui ${ARGN})
set (QT_MIN_VERSION ${ARGN})
find_package (Qt4 COMPONENTS QtCore QtGui )
set (QT_USE_QTOPENGL 1) set (QT_USE_QTOPENGL 1)
set (QT_USE_QTNETWORK 1) set (QT_USE_QTNETWORK 1)
set (QT_USE_QTSCRIPT 1) set (QT_USE_QTSCRIPT 1)
set (QT_USE_QTSQL 1) set (QT_USE_QTSQL 1)
set (QT_USE_QTXML 1) set (QT_USE_QTXML 1)
set (QT_USE_QTXMLPATTERNS 1)
set (QT_USE_QTHELP 1) set (QT_USE_QTHELP 1)
set (QT_USE_QTWEBKIT 1) set (QT_USE_QTWEBKIT 1)
set (QT_USE_QTUITOOLS 1) set (QT_USE_QTUITOOLS 1)
if (QT_QTSCRIPTTOOLS_FOUND)
set (QT_USE_QTSCRIPTTOOLS 1)
endif()
include (${QT_USE_FILE}) include (${QT_USE_FILE})
endif () endif ()
endmacro () endmacro ()
...@@ -155,14 +217,18 @@ endmacro () ...@@ -155,14 +217,18 @@ endmacro ()
# test for OpenMP # test for OpenMP
macro (acg_openmp) macro (acg_openmp)
if (NOT OPENMP_NOTFOUND) if (NOT OPENMP_NOTFOUND)
find_package(OpenMP) # Set off OpenMP on Darwin architectures
if (OPENMP_FOUND) # since it causes crashes sometimes
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") if(NOT APPLE)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") find_package(OpenMP)
add_definitions(-DUSE_OPENMP) if (OPENMP_FOUND)
else () set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (OPENMP_NOTFOUND 1) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
endif () add_definitions(-DUSE_OPENMP)
else ()
set (OPENMP_NOTFOUND 1)
endif ()
endif()
endif () endif ()
endmacro () endmacro ()
...@@ -182,21 +248,36 @@ macro (acg_ftgl) ...@@ -182,21 +248,36 @@ macro (acg_ftgl)
endmacro () endmacro ()
# append all files with extension "ext" in the "dirs" directories to "ret" # append all files with extension "ext" in the "dirs" directories to "ret"
# excludes all files starting with a '.' (dot)
macro (acg_append_files ret ext) macro (acg_append_files ret ext)
foreach (_dir ${ARGN}) foreach (_dir ${ARGN})
file (GLOB _files "${_dir}/${ext}") file (GLOB _files "${_dir}/${ext}")
foreach (_file ${_files})
get_filename_component (_filename ${_file} NAME)
if (_filename MATCHES "^[.]")
list (REMOVE_ITEM _files ${_file})
endif ()
endforeach ()
list (APPEND ${ret} ${_files}) list (APPEND ${ret} ${_files})
endforeach () endforeach ()
endmacro () endmacro ()
# append all files with extension "ext" in the "dirs" directories and its subdirectories to "ret" # append all files with extension "ext" in the "dirs" directories and its subdirectories to "ret"
# excludes all files starting with a '.' (dot)
macro (acg_append_files_recursive ret ext) macro (acg_append_files_recursive ret ext)
foreach (_dir ${ARGN}) foreach (_dir ${ARGN})
file (GLOB_RECURSE _files "${_dir}/${ext}") file (GLOB_RECURSE _files "${_dir}/${ext}")
foreach (_file ${_files})
get_filename_component (_filename ${_file} NAME)
if (_filename MATCHES "^[.]")
list (REMOVE_ITEM _files ${_file})
endif ()
endforeach ()
list (APPEND ${ret} ${_files}) list (APPEND ${ret} ${_files})
endforeach () endforeach ()
endmacro () endmacro ()
# drop all "*T.cc" files from list # drop all "*T.cc" files from list
macro (acg_drop_templates list) macro (acg_drop_templates list)
foreach (_file ${${list}}) foreach (_file ${${list}})
...@@ -281,6 +362,36 @@ macro (acg_qt4_autouic uic_SRCS) ...@@ -281,6 +362,36 @@ macro (acg_qt4_autouic uic_SRCS)
endforeach () endforeach ()
endmacro () endmacro ()
# generate qrc targets for sources in list
macro (acg_qt4_autoqrc qrc_SRCS)
set (_matching_FILES )
foreach (_current_FILE ${ARGN})
get_filename_component (_abs_FILE ${_current_FILE} ABSOLUTE)
if ( EXISTS ${_abs_FILE} )
file (READ ${_abs_FILE} _contents)
get_filename_component (_abs_PATH ${_abs_FILE} PATH)
get_filename_component (_basename ${_current_FILE} NAME_WE)
set (_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${_basename}.cpp)
add_custom_command (OUTPUT ${_outfile}
COMMAND ${QT_RCC_EXECUTABLE}
ARGS -o ${_outfile} ${_abs_FILE}
DEPENDS ${_abs_FILE})
add_file_dependencies (${_source} ${_outfile})
set (${qrc_SRCS} ${${qrc_SRCS}} ${_outfile})
endif ()
endforeach ()
endmacro ()
# get all files in directory, but ignore svn # get all files in directory, but ignore svn
macro (acg_get_files_in_dir ret dir) macro (acg_get_files_in_dir ret dir)