forked from percolator/percolator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
117 lines (95 loc) · 4.8 KB
/
CMakeLists.txt
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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#############################################################################
# NAME AND VERSION
###############################################################################
cmake_minimum_required (VERSION 2.8.11)
if(NOT CRUX AND APPLE AND ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.0)
# Identify AppleClang's COMPILER_ID as AppleClang instead of just Clang
# (https://gitlab.kitware.com/cmake/cmake/issues/19067)
cmake_policy(SET CMP0025 NEW)
endif()
project(PERCOLATOR)
set(PERCOLATOR_SOURCE_DIR ${CMAKE_SOURCE_DIR})
include("CommonCMake.txt")
###############################################################################
# PREPARING TO INSTALL
###############################################################################
my_set(CMAKE_BUILD_TYPE "Debug" "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel.")
my_set(CMAKE_PREFIX_PATH "../" "Default path to packages")
option(XML_SUPPORT "Choose to support xml input (slower compilation)." OFF)
if(XML_SUPPORT)
add_definitions(-DXML_SUPPORT)
endif(XML_SUPPORT)
# PRINT VARIBALES TO STDOUT
MESSAGE( STATUS )
MESSAGE( STATUS
"-------------------------------------------------------------------------------"
)
MESSAGE( STATUS "Building PERCOLATOR:" )
MESSAGE( STATUS "change a configuration variable with: cmake -D<Variable>=<Value>" )
MESSAGE( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )
MESSAGE( STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}" )
MESSAGE( STATUS "CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}" )
MESSAGE( STATUS "XML_SUPPORT = ${XML_SUPPORT}" )
MESSAGE( STATUS "GOOGLE_TEST = ${GOOGLE_TEST}" )
MESSAGE( STATUS "GOOGLE_TEST_PATH = ${GOOGLE_TEST_PATH}" )
MESSAGE( STATUS "TARGET_ARCH = ${TARGET_ARCH}" )
MESSAGE( STATUS "TOOL CHAIN FILE = ${CMAKE_TOOLCHAIN_FILE}")
MESSAGE( STATUS "PROFILING = ${PROFILING}")
MESSAGE( STATUS
"-------------------------------------------------------------------------------"
)
MESSAGE( STATUS )
# Detect machine architecture, on UNIX:
get_arch("${TARGET_ARCH}")
# STORE NEWLY SET VARIABLES IN *.h.cmake FILES
load_config_files("${CMAKE_CURRENT_SOURCE_DIR}")
###############################################################################
# COMPILING
###############################################################################
add_subdirectory(src)
###############################################################################
# TESTING
###############################################################################
# Enabling system level tests (Ctest)
enable_testing()
# Scheduling system level tests
add_subdirectory(data/system_tests/percolator)
add_subdirectory(tests/integration_tests/percolator)
# Scheduling unit level tests
if(GOOGLE_TEST)
add_subdirectory(tests/unit_tests/percolator)
endif()
###############################################################################
# INSTALLING
###############################################################################
if( MINGW AND XML_SUPPORT )
message( STATUS " Installing system-libraries: MinGW DLLs." )
# set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${MINGW_PATH}/bin/libgcc_s_sjlj-1.dll ${MINGW_PATH}/bin/libstdc++-6.dll ${MINGW_PATH}/bin/libxerces-c-3-1.dll ${MINGW_PATH}/bin/libboost_system.dll ${MINGW_PATH}/bin/libboost_filesystem.dll)
set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${MINGW_PATH}/bin/libxerces-c-3-1.dll)
include( InstallRequiredSystemLibraries )
endif( MINGW AND XML_SUPPORT )
if( MSVC )
set( CMAKE_INSTALL_OPENMP_LIBRARIES TRUE )
if ( XML_SUPPORT )
message( STATUS " Installing system-libraries: Win32 DLLs." )
# TODO: Some hacking is needed to install the .dll instead of the .lib. CMake plans to include these DLL variables in the future
string(REPLACE "xerces-c_3.lib" "../bin/xerces-c_3_1.dll;" XERCESC_DLL_LIBRARIES ${XERCESC_LIBRARIES})
message( STATUS " Installing Xerces DLL: ${XERCESC_DLL_LIBRARIES}")
set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${XERCESC_DLL_LIBRARIES} )
endif ( XML_SUPPORT )
include( InstallRequiredSystemLibraries )
endif( MSVC )
install(FILES src/xml/percolator_in.xsd DESTINATION ${XML_REL_PATH}/${PIN_SCHEMA_LOCATION} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES src/xml/percolator_out.xsd DESTINATION ${XML_REL_PATH}/${POUT_SCHEMA_LOCATION} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
# ###############################################################################
# # PACKAGING
# ###############################################################################
# # PACKAGING OPTIONS: GENERAL
if(NOT XML_SUPPORT)
set(NICKNAME_SUFFIX "-noxml")
endif()
set(PACKAGE_NICKNAME "percolator${NICKNAME_SUFFIX}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Percolator and qvality, two post processors for shotgun proteomics data.")
include("CPack.txt")
set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS} libc6, libgcc1")
include(CPack)