Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix to get unit tests working again on Mac.
make 'check', 'test' and 'Experimental' work from build directory to run tests.

Current caveats:
- Build will not install. Re-build with ENABLE_TESTS=FALSE to produce a build a functioning bundled .app.
- Temp QGIS.app in build/output/bin directory will start, but also needs a different symlink for finding providers. Even then, the app doesn' work right. It appears to be unnecessary for running tests, so there is no advantage to running it from the build directory.
  • Loading branch information
dakcarto committed Jun 21, 2012
1 parent fcb86cf commit 3df1c4e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CMakeLists.txt
Expand Up @@ -370,7 +370,11 @@ ELSE (WIN32)
SET (QGIS_PLUGIN_SUBDIR_REV ../../MacOS)
SET (DEFAULT_INCLUDE_SUBDIR include/qgis)
# path for framework references
SET (CMAKE_INSTALL_NAME_DIR @executable_path/${QGIS_FW_SUBDIR})
IF (ENABLE_TESTS)
SET (CMAKE_INSTALL_NAME_DIR ${CMAKE_BINARY_DIR}/output/lib)
ELSE (ENABLE_TESTS)
SET (CMAKE_INSTALL_NAME_DIR @executable_path/${QGIS_FW_SUBDIR})
ENDIF (ENABLE_TESTS)
IF (WITH_GLOBE)
SET (OSG_PLUGINS_PATH "" CACHE PATH "Path to OSG plugins for bundling")
ENDIF (WITH_GLOBE)
Expand Down Expand Up @@ -457,6 +461,13 @@ SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIB_SUBDIR})
# if run from the build directory QGIS will detect it and alter the paths
FILE(WRITE ${QGIS_OUTPUT_DIRECTORY}/${QGIS_BIN_SUBDIR}/source_path.txt "${CMAKE_SOURCE_DIR}")

# symlink provider plugins dir for Mac unit tests
IF (APPLE AND ENABLE_TESTS)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink
"${CMAKE_CURRENT_BINARY_DIR}/Plugins"
"${CMAKE_CURRENT_BINARY_DIR}/output/Plugins")
ENDIF (APPLE AND ENABLE_TESTS)

# manual page - makes sense only on unix systems
IF (UNIX AND NOT APPLE)
SET (DEFAULT_MANUAL_SUBDIR man)
Expand Down

0 comments on commit 3df1c4e

Please sign in to comment.