@@ -1,90 +1,99 | |||||
1 | # |
|
1 | # | |
2 | # sciqlop_params : Define compilation parameters |
|
2 | # sciqlop_params : Define compilation parameters | |
3 | # |
|
3 | # | |
4 | # Debug or release |
|
4 | # Debug or release | |
5 | # |
|
5 | # | |
6 | # As the "NMake Makefiles" forces by default the CMAKE_BUILD_TYPE variable to Debug, SCIQLOP_BUILD_TYPE variable is used to be sure that the debug mode is a user choice |
|
6 | # As the "NMake Makefiles" forces by default the CMAKE_BUILD_TYPE variable to Debug, SCIQLOP_BUILD_TYPE variable is used to be sure that the debug mode is a user choice | |
7 | #SET(SCIQLOP_BUILD_TYPE "Release" CACHE STRING "Choose to compile in Debug or Release mode") |
|
7 | #SET(SCIQLOP_BUILD_TYPE "Release" CACHE STRING "Choose to compile in Debug or Release mode") | |
8 |
|
8 | |||
9 | #IF(SCIQLOP_BUILD_TYPE MATCHES "Debug") |
|
9 | #IF(SCIQLOP_BUILD_TYPE MATCHES "Debug") | |
10 | # MESSAGE (STATUS "Build in Debug") |
|
10 | # MESSAGE (STATUS "Build in Debug") | |
11 | # SET (CMAKE_BUILD_TYPE "Debug") |
|
11 | # SET (CMAKE_BUILD_TYPE "Debug") | |
12 | # SET (DEBUG_SUFFIX "d") |
|
12 | # SET (DEBUG_SUFFIX "d") | |
13 | #ELSE() |
|
13 | #ELSE() | |
14 | # MESSAGE (STATUS "Build in Release") |
|
14 | # MESSAGE (STATUS "Build in Release") | |
15 | # SET (CMAKE_BUILD_TYPE "Release") |
|
15 | # SET (CMAKE_BUILD_TYPE "Release") | |
16 | # SET (SCIQLOP_BUILD_TYPE "Release") |
|
16 | # SET (SCIQLOP_BUILD_TYPE "Release") | |
17 | # SET (DEBUG_SUFFIX "") |
|
17 | # SET (DEBUG_SUFFIX "") | |
18 | #ENDIF() |
|
18 | #ENDIF() | |
19 |
|
19 | |||
|
20 | IF(CMAKE_BUILD_TYPE MATCHES "Debug") | |||
|
21 | SET (CMAKE_BUILD_TYPE "Debug") | |||
|
22 | SET (DEBUG_SUFFIX "d") | |||
|
23 | ELSE() | |||
|
24 | MESSAGE (STATUS "Build in Release") | |||
|
25 | SET (SCIQLOP_BUILD_TYPE "Release") | |||
|
26 | SET (DEBUG_SUFFIX "") | |||
|
27 | ENDIF() | |||
|
28 | ||||
20 | # |
|
29 | # | |
21 | # Need to compile tests? |
|
30 | # Need to compile tests? | |
22 | # |
|
31 | # | |
23 | OPTION (BUILD_TESTS "Build the tests" OFF) |
|
32 | OPTION (BUILD_TESTS "Build the tests" OFF) | |
24 | ENABLE_TESTING(${BUILD_TESTS}) |
|
33 | ENABLE_TESTING(${BUILD_TESTS}) | |
25 |
|
34 | |||
26 | # |
|
35 | # | |
27 | # Path to the folder for sciqlop's extern libraries. |
|
36 | # Path to the folder for sciqlop's extern libraries. | |
28 | # |
|
37 | # | |
29 | # When looking for an external library in sciqlop, we look to the following |
|
38 | # When looking for an external library in sciqlop, we look to the following | |
30 | # folders: |
|
39 | # folders: | |
31 | # - The specific folder for the library (generally of the form <LIBRARY>_ROOT_DIR |
|
40 | # - The specific folder for the library (generally of the form <LIBRARY>_ROOT_DIR | |
32 | # - The global Sciqlop extern folder |
|
41 | # - The global Sciqlop extern folder | |
33 | # - The system folders. |
|
42 | # - The system folders. | |
34 | # |
|
43 | # | |
35 | # If a dependency is found in the global extern folder or a specific folder for |
|
44 | # If a dependency is found in the global extern folder or a specific folder for | |
36 | # the library, then it is installed with the sciqlop libraries. If it is found |
|
45 | # the library, then it is installed with the sciqlop libraries. If it is found | |
37 | # in the system folders, it is not. This behavior can be overriden with the |
|
46 | # in the system folders, it is not. This behavior can be overriden with the | |
38 | # <LIBRARY>_COPY_SHARED_LIBRARIES flag. |
|
47 | # <LIBRARY>_COPY_SHARED_LIBRARIES flag. | |
39 | # |
|
48 | # | |
40 | set(SCIQLOP_EXTERN_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/extern" |
|
49 | set(SCIQLOP_EXTERN_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/extern" | |
41 | CACHE PATH "Path to the folder for sciqlop's extern libraries") |
|
50 | CACHE PATH "Path to the folder for sciqlop's extern libraries") | |
42 | option(SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR "Force the <LIBRARY>_ROOT_DIR to be updated to the global sciqlop extern folder" |
|
51 | option(SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR "Force the <LIBRARY>_ROOT_DIR to be updated to the global sciqlop extern folder" | |
43 | OFF) |
|
52 | OFF) | |
44 |
|
53 | |||
45 | if (SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR) |
|
54 | if (SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR) | |
46 | set(libRootDirForceValue FORCE) |
|
55 | set(libRootDirForceValue FORCE) | |
47 | else() |
|
56 | else() | |
48 | set(libRootDirForceValue) |
|
57 | set(libRootDirForceValue) | |
49 | endif() |
|
58 | endif() | |
50 |
|
59 | |||
51 |
|
60 | |||
52 |
|
61 | |||
53 | # |
|
62 | # | |
54 | # Static or shared libraries |
|
63 | # Static or shared libraries | |
55 | # |
|
64 | # | |
56 | OPTION (BUILD_SHARED_LIBS "Build the shared libraries" ON) |
|
65 | OPTION (BUILD_SHARED_LIBS "Build the shared libraries" ON) | |
57 |
|
66 | |||
58 | # Generate position independant code (-fPIC) |
|
67 | # Generate position independant code (-fPIC) | |
59 | SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE) |
|
68 | SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE) | |
60 |
|
69 | |||
61 | # |
|
70 | # | |
62 | # Configure installation directories |
|
71 | # Configure installation directories | |
63 | # |
|
72 | # | |
64 | IF (UNIX) |
|
73 | IF (UNIX) | |
65 | SET(defaultBin "bin") |
|
74 | SET(defaultBin "bin") | |
66 | SET(defaultInc "include/sciqlop") |
|
75 | SET(defaultInc "include/sciqlop") | |
67 |
|
76 | |||
68 | # 32 or 64 bits compiler |
|
77 | # 32 or 64 bits compiler | |
69 | IF( CMAKE_SIZEOF_VOID_P EQUAL 8 ) |
|
78 | IF( CMAKE_SIZEOF_VOID_P EQUAL 8 ) | |
70 | SET(defaultLib "lib64/sciqlop") |
|
79 | SET(defaultLib "lib64/sciqlop") | |
71 | ELSE() |
|
80 | ELSE() | |
72 | SET(defaultLib "lib/sciqlop") |
|
81 | SET(defaultLib "lib/sciqlop") | |
73 | ENDIF() |
|
82 | ENDIF() | |
74 |
|
83 | |||
75 | SET(defaultDoc "share/docs/sciqlop") |
|
84 | SET(defaultDoc "share/docs/sciqlop") | |
76 | ELSE() |
|
85 | ELSE() | |
77 | SET(defaultBin "bin") |
|
86 | SET(defaultBin "bin") | |
78 | SET(defaultInc "include/sciqlop") |
|
87 | SET(defaultInc "include/sciqlop") | |
79 | SET(defaultLib "lib/sciqlop") |
|
88 | SET(defaultLib "lib/sciqlop") | |
80 | SET(defaultDoc "docs/sciqlop") |
|
89 | SET(defaultDoc "docs/sciqlop") | |
81 | ENDIF() |
|
90 | ENDIF() | |
82 |
|
91 | |||
83 | SET(INSTALL_BINARY_DIR "${defaultBin}" CACHE STRING |
|
92 | SET(INSTALL_BINARY_DIR "${defaultBin}" CACHE STRING | |
84 | "Installation directory for binaries") |
|
93 | "Installation directory for binaries") | |
85 | SET(INSTALL_LIBRARY_DIR "${defaultLib}" CACHE STRING |
|
94 | SET(INSTALL_LIBRARY_DIR "${defaultLib}" CACHE STRING | |
86 | "Installation directory for libraries") |
|
95 | "Installation directory for libraries") | |
87 | SET(INSTALL_INCLUDE_DIR "${defaultInc}" CACHE STRING |
|
96 | SET(INSTALL_INCLUDE_DIR "${defaultInc}" CACHE STRING | |
88 | "Installation directory for headers") |
|
97 | "Installation directory for headers") | |
89 | SET(INSTALL_DOCUMENTATION_DIR "${defaultDoc}" CACHE STRING |
|
98 | SET(INSTALL_DOCUMENTATION_DIR "${defaultDoc}" CACHE STRING | |
90 | "Installation directory for documentations") |
|
99 | "Installation directory for documentations") |
General Comments 0
You need to be logged in to leave comments.
Login now