|
1 |
| -############################################################# |
2 |
| -# sources |
3 |
| - |
4 |
| -# application test |
5 |
| - |
6 |
| -SET(applicationtest_SRCS testqgsapplication.cpp) |
7 |
| -#QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/testqgsapplication.cpp testqgsapplication.moc) |
8 |
| -#SET_SOURCE_FILES_PROPERTIES(testqgsapplication.moc PROPERTIES GENERATED TRUE) |
9 |
| -SET(applicationtest_MOC_CPPS testqgsapplication.cpp) |
10 |
| -QT4_WRAP_CPP(applicationtest_MOC_SRCS ${applicationtest_MOC_CPPS}) |
11 |
| -ADD_CUSTOM_TARGET(applicationtestmoc ALL DEPENDS ${applicationtest_MOC_SRCS}) |
12 |
| -#QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/testqgsapplication.cpp moc_testqgsapplication.cxx) |
13 |
| - |
14 | 1 | #####################################################
|
15 |
| - |
16 | 2 | # Don't forget to include output directory, otherwise
|
17 | 3 | # the UI file won't be wrapped!
|
18 | 4 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
|
@@ -50,30 +36,33 @@ IF (WIN32)
|
50 | 36 | SET(PLATFORM_LIBRARIES wsock32)
|
51 | 37 | ENDIF (WIN32)
|
52 | 38 |
|
53 |
| - |
54 |
| -#note for tests we should not include the moc of our |
55 |
| -#qtests as they are directly included in teh sources |
56 |
| -#and should not be compiled twice. Trying to include |
57 |
| -#them in below will cause an error at build time |
58 |
| - |
59 |
| -ADD_EXECUTABLE(applicationtest |
60 |
| - ${applicationtest_SRCS} |
61 |
| - ) |
62 |
| -ADD_DEPENDENCIES(applicationtest applicationtestmoc) |
63 |
| -TARGET_LINK_LIBRARIES(applicationtest |
64 |
| - ${QT_LIBRARIES} |
65 |
| - qgis_core |
66 |
| -) |
67 |
| - |
68 | 39 | # Since the tests are not actually installed, but rather
|
69 | 40 | # run directly from the build/src/tests dir we need to
|
70 |
| -# ensure the libs can be found. |
| 41 | +# ensure the omg libs can be found. |
71 | 42 | IF (APPLE)
|
72 | 43 | # For Mac OS X, the executable must be at the root of the bundle's executable folder
|
73 |
| - SET (CMAKE_INSTALL_NAME_DIR @executable_path/../lib) |
74 |
| - INSTALL(TARGETS applicationtest RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) |
75 |
| -ELSE (APPLE) |
76 |
| - INSTALL(TARGETS applicationtest RUNTIME DESTINATION ${OMG_BIN_DIR}) |
| 44 | + SET (CMAKE_INSTALL_NAME_DIR @executable_path/../../../src/core) |
77 | 45 | ENDIF (APPLE)
|
78 | 46 |
|
| 47 | +#note for tests we should not include the moc of our |
| 48 | +#qtests in the executable file list as the moc is |
| 49 | +#directly included in the sources |
| 50 | +#and should not be compiled twice. Trying to include |
| 51 | +#them in will cause an error at build time |
| 52 | + |
| 53 | +############################################################# |
| 54 | +# Tests: |
| 55 | + |
| 56 | +SET(applicationtest_SRCS testqgsapplication.cpp) |
| 57 | +SET(applicationtest_MOC_CPPS testqgsapplication.cpp) |
| 58 | +QT4_WRAP_CPP(applicationtest_MOC_SRCS ${applicationtest_MOC_CPPS}) |
| 59 | +ADD_CUSTOM_TARGET(applicationtestmoc ALL DEPENDS ${applicationtest_MOC_SRCS}) |
| 60 | +ADD_EXECUTABLE(applicationtest ${applicationtest_SRCS}) |
| 61 | +ADD_DEPENDENCIES(applicationtest applicationtestmoc) |
| 62 | +TARGET_LINK_LIBRARIES(applicationtest ${QT_LIBRARIES} qgis_core) |
| 63 | +INSTALL(TARGETS applicationtest RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) |
79 | 64 | ADD_TEST(application ${CMAKE_CURRENT_BINARY_DIR}/applicationtest)
|
| 65 | + |
| 66 | +# |
| 67 | +## |
| 68 | +# |
0 commit comments