don't link against X11 on OS X
[mussa.git] / alg / test / CMakeLists.txt
1 FIND_PACKAGE(OpenGL)
2 INCLUDE(FindBoost)
3 FIND_PACKAGE(Qt4)
4 INCLUDE( ${QT_USE_FILE} )
5 INCLUDE(Platform)
6
7 SET(SOURCES 
8       test_alphabet.cpp 
9       test_annotation_color.cpp 
10       test_color.cpp 
11       test_conserved_path.cpp
12       test_flp.cpp 
13       test_glseqbrowser.cpp 
14       test_glsequence.cpp
15       test_main.cpp
16       test_mussa.cpp 
17       test_nway.cpp 
18       test_sequence.cpp 
19       test_sequence_location.cpp )
20
21 GET_MUSSA_COMPILE_FLAGS(ALG_TEST_CFLAGS)
22 GET_MUSSA_LINK_FLAGS(ALG_TEST_LDFLAGS)
23 # dont you love the number of \ you need to make sure the " shows up in
24 # the C compiler?
25 SET(EXAMPLE_DIR ${CMAKE_SOURCE_DIR}/examples)
26 IF(WIN32)
27   STRING(REGEX REPLACE "/" "\\\\\\\\\\\\\\\\" EXAMPLE_DIR ${EXAMPLE_DIR})
28 ENDIF(WIN32)
29
30 SET_SOURCE_FILES_PROPERTIES(
31   ${SOURCES} 
32   COMPILE_FLAGS "-DEXAMPLE_DIR=\\\"${EXAMPLE_DIR}\\\" ${ALG_TEST_CFLAGS}"
33 )
34
35 ADD_EXECUTABLE(unittest ${SOURCES})
36 ADD_TEST(core_test ${CMAKE_BINARY_DIR}/alg/test/unittest)
37 LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/alg})
38 TARGET_LINK_LIBRARIES(unittest 
39                         mussa_core
40                         ${QT_LIBRARIES}
41                         ${BOOST_FILESYSTEM_LIBRARY}
42                         ${BOOST_UNIT_TEST_LIBRARY} 
43                         ${BOOST_SERIALIZATION_LIBRARY}
44                         ${OPENGL_gl_LIBRARY})
45
46 SET_TARGET_PROPERTIES(
47   unittest PROPERTIES
48     COMPILE_FLAGS "${ALG_TEST_CFLAGS}"
49     LINK_FLAGS "${ALG_TEST_LDFLAGS}"
50 )
51