Changeset View
Changeset View
Standalone View
Standalone View
CMakeLists.txt
1 | # The CMake version we require | 1 | # The CMake version we require | ||
---|---|---|---|---|---|
2 | cmake_minimum_required(VERSION 3.1) | 2 | cmake_minimum_required(VERSION 3.1) | ||
3 | 3 | | |||
4 | # Setting the name of the main project | 4 | # Setting the name of the main project | ||
5 | project(KMyMoney VERSION "5.0.80") | 5 | project(KMyMoney VERSION "5.0.80" LANGUAGES CXX) | ||
6 | 6 | | |||
7 | # Determine the GIT reference (if we're based on GIT) | 7 | # Determine the GIT reference (if we're based on GIT) | ||
8 | if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") | 8 | if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") | ||
9 | execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE VERSION_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) | 9 | execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE VERSION_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
10 | set(VERSION_SUFFIX "-${VERSION_SUFFIX}") | 10 | set(VERSION_SUFFIX "-${VERSION_SUFFIX}") | ||
11 | # Add variables which are similar to the build in names of cmake | 11 | # Add variables which are similar to the build in names of cmake | ||
12 | set(PROJECT_VERSION_SUFFIX "${VERSION_SUFFIX}") | 12 | set(PROJECT_VERSION_SUFFIX "${VERSION_SUFFIX}") | ||
13 | set(${PROJECT_NAME}_VERSION_SUFFIX "${VERSION_SUFFIX}") | 13 | set(${PROJECT_NAME}_VERSION_SUFFIX "${VERSION_SUFFIX}") | ||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | 90 | if(DOXYGEN_FOUND) | |||
93 | make_directory("${APIDOC_DIR}") | 93 | make_directory("${APIDOC_DIR}") | ||
94 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kmymoney.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/kmymoney.doxygen IMMEDIATE) | 94 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kmymoney.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/kmymoney.doxygen IMMEDIATE) | ||
95 | 95 | | |||
96 | add_custom_target(apidoc "${DOXYGEN}" "${CMAKE_CURRENT_BINARY_DIR}/kmymoney.doxygen") | 96 | add_custom_target(apidoc "${DOXYGEN}" "${CMAKE_CURRENT_BINARY_DIR}/kmymoney.doxygen") | ||
97 | endif(DOXYGEN_FOUND) | 97 | endif(DOXYGEN_FOUND) | ||
98 | 98 | | |||
99 | # check some include files exists | 99 | # check some include files exists | ||
100 | set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE) | 100 | set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE) | ||
101 | include (CheckIncludeFile) | 101 | include (CheckIncludeFileCXX) | ||
102 | check_include_file("unistd.h" HAVE_UNISTD_H) | 102 | check_include_file_cxx("unistd.h" HAVE_UNISTD_H) | ||
103 | check_include_file("pwd.h" HAVE_PWD_H) | 103 | check_include_file_cxx("pwd.h" HAVE_PWD_H) | ||
104 | check_include_file("windows.h" HAVE_WINDOWS_H) | 104 | check_include_file_cxx("windows.h" HAVE_WINDOWS_H) | ||
105 | check_include_file("lmcons.h" HAVE_LMCONS_H) | 105 | check_include_file_cxx("lmcons.h" HAVE_LMCONS_H) | ||
106 | check_include_file("process.h" HAVE_PROCESS_H) | 106 | check_include_file_cxx("process.h" HAVE_PROCESS_H) | ||
107 | 107 | | |||
108 | # include check for members in structs | 108 | # include check for members in structs | ||
109 | include (CheckStructHasMember) | 109 | include (CheckStructHasMember) | ||
110 | 110 | | |||
111 | ######################### Special Requirements ########################## | 111 | ######################### Special Requirements ########################## | ||
112 | 112 | | |||
113 | # This is needed for QtSqlite and QtDesigner | 113 | # This is needed for QtSqlite and QtDesigner | ||
114 | # (they'll install files to ${QT_INSTALL_DIR}/plugins/) | 114 | # (they'll install files to ${QT_INSTALL_DIR}/plugins/) | ||
Show All 29 Lines | 142 | if(LIBOFX_FOUND) | |||
144 | if(CMAKE_SYSTEM_NAME MATCHES "Windows") | 144 | if(CMAKE_SYSTEM_NAME MATCHES "Windows") | ||
145 | set(PATH_TO_LIBOFX_HEADER "${LIBOFX_INCLUDE_DIR}/libofx/libofx.h") # Windows doesn't even see the header if it's not full path | 145 | set(PATH_TO_LIBOFX_HEADER "${LIBOFX_INCLUDE_DIR}/libofx/libofx.h") # Windows doesn't even see the header if it's not full path | ||
146 | else() | 146 | else() | ||
147 | set(PATH_TO_LIBOFX_HEADER "libofx/libofx.h") | 147 | set(PATH_TO_LIBOFX_HEADER "libofx/libofx.h") | ||
148 | endif() | 148 | endif() | ||
149 | 149 | | |||
150 | unset(LIBOFX_HAVE_CLIENTUID) | 150 | unset(LIBOFX_HAVE_CLIENTUID) | ||
151 | unset(LIBOFX_HAVE_CLIENTUID CACHE) #not doing this will prevent updating below check | 151 | unset(LIBOFX_HAVE_CLIENTUID CACHE) #not doing this will prevent updating below check | ||
152 | check_struct_has_member("struct OfxFiLogin" clientuid ${PATH_TO_LIBOFX_HEADER} LIBOFX_HAVE_CLIENTUID) | 152 | check_struct_has_member("struct OfxFiLogin" clientuid ${PATH_TO_LIBOFX_HEADER} LIBOFX_HAVE_CLIENTUID LANGUAGE CXX) | ||
153 | if(NOT ENABLE_OFXIMPORTER) | 153 | if(NOT ENABLE_OFXIMPORTER) | ||
154 | unset(LIBOFX_FOUND CACHE) | 154 | unset(LIBOFX_FOUND CACHE) | ||
155 | unset(LIBOFX_HAVE_CLIENTUID CACHE) | 155 | unset(LIBOFX_HAVE_CLIENTUID CACHE) | ||
156 | endif(NOT ENABLE_OFXIMPORTER) | 156 | endif(NOT ENABLE_OFXIMPORTER) | ||
157 | else(LIBOFX_FOUND) | 157 | else(LIBOFX_FOUND) | ||
158 | option(ENABLE_OFXIMPORTER "Enable OFX Importer" OFF) | 158 | option(ENABLE_OFXIMPORTER "Enable OFX Importer" OFF) | ||
159 | if(ENABLE_OFXIMPORTER) | 159 | if(ENABLE_OFXIMPORTER) | ||
160 | unset(LIBOFX_FOUND CACHE) | 160 | unset(LIBOFX_FOUND CACHE) | ||
▲ Show 20 Lines • Show All 221 Lines • Show Last 20 Lines |