Fix merge issues with the win32 library patch
[mussa.git] / alg / test / CMakeLists.txt
1 FIND_PACKAGE(OpenGL)
2 INCLUDE(FindBoost)
3 INCLUDE(Platform)
4
5 SET(SOURCES test_annotation_color.cpp test_color.cpp test_conserved_path.cpp
6             test_flp.cpp test_glseqbrowser.cpp test_glsequence.cpp
7             test_main.cpp test_mussa.cpp test_nway.cpp 
8             test_sequence.cpp test_sequence_location.cpp )
9
10 GET_MUSSA_COMPILE_FLAGS(ALG_TEST_CFLAGS)
11 GET_MUSSA_LINK_FLAGS(ALG_TEST_LDFLAGS)
12 # dont you love the number of \ you need to make sure the " shows up in
13 # the C compiler?
14 SET(EXAMPLE_DIR ${CMAKE_SOURCE_DIR}/examples)
15 IF(WIN32)
16   STRING(REGEX REPLACE "/" "\\\\\\\\\\\\\\\\" EXAMPLE_DIR ${EXAMPLE_DIR})
17 ENDIF(WIN32)
18
19 SET_SOURCE_FILES_PROPERTIES(
20   ${SOURCES} 
21   COMPILE_FLAGS "-DEXAMPLE_DIR=\\\"${EXAMPLE_DIR}\\\" ${ALG_TEST_CFLAGS}"
22 )
23
24 ADD_EXECUTABLE(unittest ${SOURCES})
25 ADD_TEST(core_test ${CMAKE_BINARY_DIR}/alg/test/unittest)
26 LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/alg})
27 TARGET_LINK_LIBRARIES(unittest 
28                         mussa_core 
29                         ${BOOST_FILESYSTEM_LIBRARY}
30                         ${BOOST_UNIT_TEST_LIBRARY} 
31                         ${BOOST_SERIALIZATION_LIBRARY}
32                         ${OPENGL_gl_LIBRARY})
33
34 SET_TARGET_PROPERTIES(
35   unittest PROPERTIES
36     COMPILE_FLAGS "${ALG_TEST_CFLAGS}"
37     LINK_FLAGS "${ALG_TEST_LDFLAGS}"
38 )
39