diff --git a/tests/src/core/CMakeLists.txt b/tests/src/core/CMakeLists.txt index 275757a6c985..97fd4b371f94 100644 --- a/tests/src/core/CMakeLists.txt +++ b/tests/src/core/CMakeLists.txt @@ -1,18 +1,4 @@ -############################################################# -# sources - -# application test - -SET(applicationtest_SRCS testqgsapplication.cpp) -#QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/testqgsapplication.cpp testqgsapplication.moc) -#SET_SOURCE_FILES_PROPERTIES(testqgsapplication.moc PROPERTIES GENERATED TRUE) -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} @@ -50,30 +36,33 @@ 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} - ) -ADD_DEPENDENCIES(applicationtest applicationtestmoc) -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. +# ensure the omg 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}) + SET (CMAKE_INSTALL_NAME_DIR @executable_path/../../../src/core) ENDIF (APPLE) +#note for tests we should not include the moc of our +#qtests in the executable file list as the moc is +#directly included in the sources +#and should not be compiled twice. Trying to include +#them in will cause an error at build time + +############################################################# +# Tests: + +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}) +ADD_EXECUTABLE(applicationtest ${applicationtest_SRCS}) +ADD_DEPENDENCIES(applicationtest applicationtestmoc) +TARGET_LINK_LIBRARIES(applicationtest ${QT_LIBRARIES} qgis_core) +INSTALL(TARGETS applicationtest RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) ADD_TEST(application ${CMAKE_CURRENT_BINARY_DIR}/applicationtest) + +# +## +#