Merge branch 'master' of https://git.lemmasoftware.org/Merlin
[Merlin.git] / CMakeLists.txt
1 # Configure Merlin 
2 set(MERLIN_VERSION_MAJOR "0")
3 set(MERLIN_VERSION_MINOR "0")
4 set(MERLIN_VERSION_PATCH "2")
5 set(MERLIN_VERSION "\"${MERLIN_VERSION_MAJOR}.${MERLIN_VERSION_MINOR}.${MERLIN_VERSION_PATCH}\"")
6 set(MERLIN_VERSION_NOQUOTES "${MERLIN_VERSION_MAJOR}.${MERLIN_VERSION_MINOR}.${MERLIN_VERSION_PATCH}")
7
8 configure_file (
9         "${CMAKE_CURRENT_SOURCE_DIR}/config/MerlinConfig.h.in"
10         "${PROJECT_BINARY_DIR}/include/MerlinConfig.h"
11 )
12 install ( FILES  ${PROJECT_BINARY_DIR}/include/MerlinConfig.h   DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ )
13
14 add_subdirectory("src")
15 add_library( merlin ${MERLINSOURCE} )  
16 target_include_directories( merlin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
17
18 set_target_properties(merlin PROPERTIES 
19         VERSION  "${MERLIN_VERSION_NOQUOTES}"
20         SOVERSION "${MERLIN_VERSION_MAJOR}.${MERLIN_VERSION_MINOR}"
21         PROJECT_LABEL "MERLIN ${LABEL_SUFFIX}"
22 )
23
24 # Linking
25 target_link_libraries(merlin "lemmacore" "fdem1d" )
26
27 # Linking
28 if ( LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT ) 
29         target_link_libraries(merlin ${VTK_LIBRARIES})
30 endif()
31
32 # Testing
33 if (LEMMA_ENABLE_TESTING)
34         add_subdirectory(testing)
35 endif()
36
37 # Install
38 install ( TARGETS merlin DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
39 install ( FILES include/Merlin  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma ) 
40 install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma  FILES_MATCHING PATTERN "*.h")
41
42 #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/  FILES_MATCHING PATTERN "FDEM1D")
43 #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/FDEM1D  FILES_MATCHING PATTERN "*.h")
44
45 # Examples
46 if (LEMMA_BUILD_EXAMPLES)
47         add_subdirectory(examples)
48 endif()