Skip to content

Commit f875996

Browse files

File tree

1 file changed

+23
-34
lines changed

1 file changed

+23
-34
lines changed
 

‎tests/src/core/CMakeLists.txt

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
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-
141
#####################################################
15-
162
# Don't forget to include output directory, otherwise
173
# the UI file won't be wrapped!
184
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
@@ -50,30 +36,33 @@ IF (WIN32)
5036
SET(PLATFORM_LIBRARIES wsock32)
5137
ENDIF (WIN32)
5238

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-
6839
# Since the tests are not actually installed, but rather
6940
# 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.
7142
IF (APPLE)
7243
# 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)
7745
ENDIF (APPLE)
7846

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})
7964
ADD_TEST(application ${CMAKE_CURRENT_BINARY_DIR}/applicationtest)
65+
66+
#
67+
##
68+
#

0 commit comments

Comments
 (0)
Please sign in to comment.