Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

CMakeLists.txt 3.44 KB
Newer Older
1 2 3 4 5 6
### CMakeLists.txt --- 
## 
## Author: Julien Wintz
## Copyright (C) 2008-2011 - Julien Wintz, Inria.
## Created: Thu Mar  1 14:34:49 2012 (+0100)
## Version: $Id$
7
## Last-Updated: Fri Apr 27 20:53:38 2012 (+0200)
8
##           By: Julien Wintz
9
##     Update #: 34
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
######################################################################
## 
### Commentary: 
## 
######################################################################
## 
### Change log:
## 
######################################################################

project(dtkLog)

## #################################################################
## Sources
## #################################################################

set(${PROJECT_NAME}_HEADERS
  dtkLog.h
  dtkLogger.h
  dtkLogEngine.h
Julien Wintz's avatar
Julien Wintz committed
30
  dtkLogDestination.h
Julien Wintz's avatar
Julien Wintz committed
31
  dtkLogModel.h
Julien Wintz's avatar
Julien Wintz committed
32
  dtkLogView.h)
33

Julien Wintz's avatar
Julien Wintz committed
34
set(${PROJECT_NAME}_HEADERS_MOC
Julien Wintz's avatar
Julien Wintz committed
35
  dtkLogModel.h
Julien Wintz's avatar
Julien Wintz committed
36 37
  dtkLogView.h
  dtkLogView_p.h)
38 39

set(${PROJECT_NAME}_SOURCES
40
  dtkLog.cpp
41 42
  dtkLogger.cpp
  dtkLogEngine.cpp
Julien Wintz's avatar
Julien Wintz committed
43
  dtkLogDestination.cpp
Julien Wintz's avatar
Julien Wintz committed
44
  dtkLogModel.cpp
Julien Wintz's avatar
Julien Wintz committed
45
  dtkLogView.cpp)
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82

## #################################################################
## Build rules
## #################################################################

if(NOT WIN32)
add_definitions(-Wno-write-strings)
endif(NOT WIN32)

add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_SHARED)

if(NOT WIN32)
  add_definitions(-DQT_NO_DEBUG)
endif(NOT WIN32)

qt4_wrap_cpp(${PROJECT_NAME}_SOURCES_MOC ${${PROJECT_NAME}_HEADERS_MOC})

if(BUILD_SHARED_LIBS)

add_library(${PROJECT_NAME} SHARED
  ${${PROJECT_NAME}_SOURCES}
  ${${PROJECT_NAME}_HEADERS}
  ${${PROJECT_NAME}_SOURCES_MOC})

else(BUILD_SHARED_LIBS)

add_library(${PROJECT_NAME} STATIC
  ${${PROJECT_NAME}_SOURCES}
  ${${PROJECT_NAME}_HEADERS}
  ${${PROJECT_NAME}_SOURCES_MOC})

endif(BUILD_SHARED_LIBS)

target_link_libraries(${PROJECT_NAME}
  ${QT_LIBRARIES})

83 84 85 86 87 88 89 90 91 92
## #################################################################
## Export header file
## #################################################################

add_compiler_export_flags()

generate_export_header(${PROJECT_NAME}
  EXPORT_FILE_NAME "${PROJECT_NAME}Export.h")

add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
93 94
  COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}"
  COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Export.h" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export")
95 96 97

set(${PROJECT_NAME}_HEADERS
  ${${PROJECT_NAME}_HEADERS}
98
 "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export.h")
99

100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
## #################################################################
## Source file layout in development environments like Visual Studio
## #################################################################

SOURCE_GROUP("Header Files" REGULAR_EXPRESSION .*\\.h\$)
SOURCE_GROUP("Generated Files" FILES ${${PROJECT_NAME}_SOURCES_MOC})

## #################################################################
## Installation
## #################################################################

foreach(header ${${PROJECT_NAME}_HEADERS})
  string(REGEX REPLACE "(.*)\\.h\$" "\\1" h ${header})
  set(${PROJECT_NAME}_HEADERS_QTS "${${PROJECT_NAME}_HEADERS_QTS}" ${h})
endforeach(header)

install(FILES ${${PROJECT_NAME}_HEADERS} DESTINATION include/${PROJECT_NAME})
install(FILES ${${PROJECT_NAME}_HEADERS_QTS} DESTINATION include/${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME}
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib)