-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commits to build qtests from cmake / ctest. Non functional yet
git-svn-id: http://svn.osgeo.org/qgis/trunk@6949 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
timlinux
committed
May 21, 2007
1 parent
be639d1
commit c90f2c4
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
IF (ENABLE_TESTS) | ||
SUBDIRS(src) | ||
ENDIF (ENABLE_TESTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
IF (ENABLE_TESTS) | ||
SUBDIRS(core) | ||
ENDIF (ENABLE_TESTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
############################################################# | ||
# sources | ||
|
||
# application test | ||
|
||
SET(applicationtest_SRCS testqgsapplication.cpp) | ||
SET(applicationtest_MOC_CPPS testqgsapplication.cpp) | ||
QT4_WRAP_CPP(applicationtest_MOC_SRCS ${applicationtest_MOC_CPPS}) | ||
ADD_CUSTOM_TARGET(applicationtestmoc ALL DEPENDS ${applicationtest_MOC_SRCS}) | ||
#QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/testqgsapplication.cpp moc_testqgsapplication.cxx) | ||
|
||
##################################################### | ||
|
||
# Don't forget to include output directory, otherwise | ||
# the UI file won't be wrapped! | ||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/core | ||
${QT_INCLUDE_DIR} | ||
${GDAL_INCLUDE_DIR} | ||
${PROJ_INCLUDE_DIR} | ||
${GEOS_INCLUDE_DIR} | ||
) | ||
|
||
# expect that classes are being IMPORTED for the exe | ||
IF (WIN32) | ||
# expect that classes are being imported | ||
# Note: MSVC doesn't like when the macros are quotes | ||
# and MSYS doesn't like them unqouted (bacause of braces) | ||
IF (MSVC) | ||
ADD_DEFINITIONS("-DCORE_EXPORT=__declspec(dllimport)") | ||
#ADD_DEFINITIONS("-DPLUGIN_EXPORT=__declspec(dllimport)") | ||
#next needed for qgis gui includes | ||
ADD_DEFINITIONS("-DGUI_EXPORT=__declspec(dllexport)") | ||
ELSE (MSVC) | ||
ADD_DEFINITIONS("\"-DCORE_EXPORT=__declspec(dllimport)\"") | ||
#ADD_DEFINITIONS("\"-DPLUGIN_EXPORT=__declspec(dllimport)\"") | ||
#next needed for qgis gui includes | ||
ADD_DEFINITIONS("\"-DGUI_EXPORT=__declspec(dllexport)\"") | ||
ENDIF (MSVC) | ||
ENDIF (WIN32) | ||
|
||
############################################################# | ||
# libraries | ||
|
||
# because of htonl | ||
IF (WIN32) | ||
SET(PLATFORM_LIBRARIES wsock32) | ||
ENDIF (WIN32) | ||
|
||
|
||
#note for tests we should not include the moc of our | ||
#qtests as they are directly included in teh sources | ||
#and should not be compiled twice. Trying to include | ||
#them in below will cause an error at build time | ||
|
||
ADD_EXECUTABLE(applicationtest | ||
${applicationtest_SRCS} | ||
) | ||
TARGET_LINK_LIBRARIES(applicationtest | ||
${QT_LIBRARIES} | ||
qgis_core | ||
) | ||
|
||
# Since the tests are not actually installed, but rather | ||
# run directly from the build/src/tests dir we need to | ||
# ensure the libs can be found. | ||
IF (APPLE) | ||
# For Mac OS X, the executable must be at the root of the bundle's executable folder | ||
SET (CMAKE_INSTALL_NAME_DIR @executable_path/../lib) | ||
INSTALL(TARGETS applicationtest RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
ELSE (APPLE) | ||
INSTALL(TARGETS applicationtest RUNTIME DESTINATION ${OMG_BIN_DIR}) | ||
ENDIF (APPLE) | ||
|
||
ADD_TEST(application ${CMAKE_CURRENT_BINARY_DIR}/applicationtest) |