]> Creatis software - bbtk.git/blob - kernel/cmake/BBTKKernelConfig.cmake
Feature #1774
[bbtk.git] / kernel / cmake / BBTKKernelConfig.cmake
1  # ---------------------------------------------------------------------
2  #
3  # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4  #                        pour la SantÈ)
5  # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6  # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7  # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8  #
9  #  This software is governed by the CeCILL-B license under French law and
10  #  abiding by the rules of distribution of free software. You can  use,
11  #  modify and/ or redistribute the software under the terms of the CeCILL-B
12  #  license as circulated by CEA, CNRS and INRIA at the following URL
13  #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14  #  or in the file LICENSE.txt.
15  #
16  #  As a counterpart to the access to the source code and  rights to copy,
17  #  modify and redistribute granted by the license, users are provided only
18  #  with a limited warranty  and the software's author,  the holder of the
19  #  economic rights,  and the successive licensors  have only  limited
20  #  liability.
21  #
22  #  The fact that you are presently reading this means that you have had
23  #  knowledge of the CeCILL-B license and that you accept its terms.
24  # ------------------------------------------------------------------------ */
25
26
27
28 #----------------------------------------------------------------------------
29 # BINARY DIR MUST BE IN INCLUDE DIRS 
30 # TO FIND .h OF AUTOMATICALLY GENERATED FILES (e.g. FROM XML)
31 INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR}/kernel/src ) 
32 # SOURCES DIR MUST ALSO BE IN INCLUDE DIRS FOR FILES COMPILED IN BINARY DIR 
33 # WHICH NEED TO INCLUDE OTHER FILES OF THE PACKAGE
34 INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/kernel/src )
35 INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/kernel/src/ThirdParty )
36 #----------------------------------------------------------------------------
37
38 #----------------------------------------------------------------------------
39 # THE PACKAGES ARE CORE ONES
40 SET(BBTK_CORE_PACKAGE TRUE)
41 #----------------------------------------------------------------------------
42
43 #-----------------------------------------------------------------------------
44 # Path for binaries 
45 IF(WIN32) # OR APPLE)
46   SET (EXECUTABLE_OUTPUT_REL_PATH "") 
47   SET (LIBRARY_OUTPUT_REL_PATH    "")
48   IF(WIN32)
49         SET (ADDITIONAL_DLL_PATH "C:/Program Files/CreaTools/crea_ThirdParty_dlls-3.0.0/bin" CACHE PATH "Additional paths in which to look for dlls")
50   ENDIF(WIN32)
51 ELSE(WIN32) # OR APPLE)
52   SET (EXECUTABLE_OUTPUT_REL_PATH bin) 
53   SET (LIBRARY_OUTPUT_REL_PATH    bin)
54 ENDIF(WIN32) # OR APPLE)  
55
56 SET (EXECUTABLE_OUTPUT_PATH 
57   ${PROJECT_BINARY_DIR}/${EXECUTABLE_OUTPUT_REL_PATH})
58 SET (LIBRARY_OUTPUT_PATH    
59   ${PROJECT_BINARY_DIR}/${LIBRARY_OUTPUT_REL_PATH})
60 #-----------------------------------------------------------------------------
61
62
63
64 #-----------------------------------------------------------------------------
65 # The var BBTK_BIN_PATH
66 # gives the system-dependent path to output binaries
67 # BBTK_BBI, BBTK_BBFY and BBTK_BBDOC 
68 # point to the system-dependent applications 
69 # (.exe on win / no extension on lin) 
70 # WARNING : 
71 # On WIN32, these paths will only be right at *BUILD TIME* in VS6 or .net
72 # Cannot be used at cmake run time !
73
74 SET(BBTK_LIB_PATH ${CMAKE_CREA_LIB_PATH} )
75
76 IF(WIN32)
77   IF(MSVC10)  #FCY 18-06-10
78           SET(BBTK_BIN_PATH $(OutDir))
79   ELSE(MSVC10)
80           IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
81             SET(BBTK_BIN_PATH ${EXECUTABLE_OUTPUT_PATH}/$(IntDir))
82           ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
83             SET(BBTK_BIN_PATH $(SolutionDir)/$(OutDir))
84           ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
85   ENDIF(MSVC10)
86   SET(BBTK_BBS2CPP ${BBTK_BIN_PATH}/bbs2cpp.exe)
87   SET(BBTK_BBC ${BBTK_BIN_PATH}/bbc.exe)
88   SET(BBTK_BBI ${BBTK_BIN_PATH}/bbi.exe)
89   SET(BBTK_BBFY ${BBTK_BIN_PATH}/bbfy.exe)
90
91 ELSE(WIN32)
92 # For Xcode : have to test the cmake generator !
93   IF ( CMAKE_GENERATOR STREQUAL Xcode)
94     SET(BBTK_BIN_PATH ${EXECUTABLE_OUTPUT_PATH}/Debug)
95   ELSE(CMAKE_GENERATOR STREQUAL Xcode)
96     SET(BBTK_BIN_PATH ${EXECUTABLE_OUTPUT_PATH})
97   ENDIF(CMAKE_GENERATOR STREQUAL Xcode) 
98   SET(BBTK_BBI ${BBTK_BIN_PATH}/bbi)
99   SET(BBTK_BBS2CPP ${BBTK_BIN_PATH}/bbs2cpp)
100   SET(BBTK_BBC ${BBTK_BIN_PATH}/bbc)
101   SET(BBTK_BBFY ${BBTK_BIN_PATH}/bbfy)
102 ENDIF(WIN32)  
103 SET(BBTK_PACKAGE_LIB_PATH ${BBTK_LIB_PATH})
104
105 MESSAGE(STATUS "")
106 MESSAGE(STATUS "===============================================")
107 MESSAGE(STATUS "Setting up base pathes:")
108 MESSAGE(STATUS "* BBTK_BIN_PATH         =${BBTK_BIN_PATH}")
109 MESSAGE(STATUS "* BBTK_LIB_PATH         =${BBTK_LIB_PATH}")
110 MESSAGE(STATUS "* BBTK_PACKAGE_LIB_PATH =${BBTK_PACKAGE_LIB_PATH}")
111 MESSAGE(STATUS "* BBTK_BBI              =${BBTK_BBI}")
112 MESSAGE(STATUS "* BBTK_BBS2CPP          =${BBTK_BBS2CPP}")
113 MESSAGE(STATUS "* BBTK_BBC              =${BBTK_BBC}")
114 MESSAGE(STATUS "* BBTK_BBFY             =${BBTK_BBFY}")
115 #-----------------------------------------------------------------------------
116
117 #-----------------------------------------------------------------------------
118 # The vars BBTK_DOC_REL_PATH and BBTK_BBS_REL_PATH
119 # store documentation and scripts **RELATIVE** paths  
120 # from build tree root or install tree root
121 # (different on win/lin)
122 IF(WIN32)
123   # A trick to install in root install dir (problem when empty path given)
124   SET(BBTK_SHARE_REL_PATH "bin/..")
125   SET(BBTK_DOC_REL_PATH doc)
126   SET(BBTK_BBS_REL_PATH bbs)
127   SET(BBTK_DATA_REL_PATH data)
128 ELSE(WIN32)
129   SET(BBTK_SHARE_REL_PATH share/bbtk)
130   SET(BBTK_DOC_REL_PATH share/bbtk/doc)
131   SET(BBTK_BBS_REL_PATH share/bbtk/bbs)
132   SET(BBTK_DATA_REL_PATH share/bbtk/data)
133 ENDIF(WIN32)   
134
135 MESSAGE(STATUS "* BBTK_SHARE_REL_PATH   =${BBTK_SHARE_REL_PATH}")
136 MESSAGE(STATUS "* BBTK_DOC_REL_PATH     =${BBTK_DOC_REL_PATH}")
137 MESSAGE(STATUS "* BBTK_BBS_REL_PATH     =${BBTK_BBS_REL_PATH}")
138 MESSAGE(STATUS "* BBTK_DATA_REL_PATH    =${BBTK_DATA_REL_PATH}")
139 MESSAGE(STATUS "===============================================")
140
141 #-----------------------------------------------------------------------------