File: CMakeLists.txt

package info (click to toggle)
liggghts 3.5.0%2Brepack1-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 28,712 kB
  • ctags: 14,082
  • sloc: cpp: 136,869; ansic: 1,446; python: 676; sh: 603; makefile: 358
file content (57 lines) | stat: -rw-r--r-- 1,936 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FILE(GLOB SRC_FILES_SRC "*.cpp")
SET(SRC_FILES ${SRC_FILES_SRC})

FILE(GLOB SRC_FILES_HEAD "*.h")

FOREACH(SUB_DIR_ADD ${MODULES_PACKAGE} ${MODULES_USER})
 MESSAGE("SUB_DIR_ADD: ${SUB_DIR_ADD}")
 FILE(GLOB SRC_FILES_ADD "${SUB_DIR_ADD}/*.cpp")
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/${SUB_DIR_ADD})
 SET(SRC_FILES ${SRC_FILES} ${SRC_FILES_ADD})
ENDFOREACH(SUB_DIR_ADD ${MODULES_PACKAGE} ${MODULES_USER})


#======================================================
IF (USERPATH)
  SET(CMAKE_SKIP_BUILD_RPATH FALSE)
  SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/")
  SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
ENDIF (USERPATH)
#======================================================

FILE(GLOB to_remove main.cpp)
LIST(REMOVE_ITEM SRC_FILES ${to_remove})

ADD_LIBRARY(libliggghts SHARED ${SRC_FILES})
TARGET_LINK_LIBRARIES(libliggghts ${Boost_LIBRARIES})
SET_TARGET_PROPERTIES(libliggghts PROPERTIES 
  OUTPUT_NAME "liggghts${SUFFIX}"
  VERSION ${VERSION}
  SOVERSION 3)

IF(JPEG_FOUND)
  TARGET_LINK_LIBRARIES(libliggghts ${JPEG_LIBRARIES})
ENDIF(JPEG_FOUND)

IF(VTK_FOUND)
  IF(${VTK_MAJOR_VERSION} EQUAL 6)
    TARGET_LINK_LIBRARIES(libliggghts ${VTK_LIBRARIES})
  ELSE(${VTK_MAJOR_VERSION} EQUAL 6)
    TARGET_LINK_LIBRARIES(libliggghts vtkHybrid)
  ENDIF(${VTK_MAJOR_VERSION} EQUAL 6)
ENDIF(VTK_FOUND)

INSTALL(TARGETS libliggghts DESTINATION "${CMAKE_INSTALL_LIBDIR}/")
#======================================================

ADD_EXECUTABLE(liggghts main.cpp)
SET_TARGET_PROPERTIES(liggghts PROPERTIES OUTPUT_NAME "liggghts${SUFFIX}")
TARGET_LINK_LIBRARIES(liggghts libliggghts)

INSTALL(TARGETS liggghts DESTINATION "${CMAKE_INSTALL_BINDIR}/")

#======================================================

INSTALL(FILES ${SRC_FILES_HEAD} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/liggghts${SUFFIX}/")
#======================================================