File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,5 +61,7 @@ if(NO_WINDOWS_SEH)
6161 add_definitions (-DNO_WINDOWS_SEH )
6262endif ()
6363
64- file (TO_CMAKE_PATH ${FILESDIR} _filesdir )
65- add_definitions (-DFILESDIR= "${_filesdir} " )
64+ if (FILESDIR_DEF)
65+ file (TO_CMAKE_PATH "${FILESDIR_DEF} " _filesdir )
66+ add_definitions (-DFILESDIR= "${_filesdir} " )
67+ endif ()
Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ option(NO_UNIX_SIGNAL_HANDLING "Disable usage of Unix Signal Handling"
7575option (NO_UNIX_BACKTRACE_SUPPORT "Disable usage of Unix Backtrace support" OFF )
7676option (NO_WINDOWS_SEH "Disable usage of Windows SEH" OFF )
7777
78+ # TODO: disable by default like make build?
79+ option (FILESDIR "Hard-coded directory for files to load from" OFF )
80+
7881if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16" )
7982 set (CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers" )
8083 # need to disable the prologue or it will be treated like a system header and not emit any warnings
@@ -95,5 +98,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
9598set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} /lib)
9699set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} /lib)
97100
98- set (FILESDIR ${CMAKE_INSTALL_PREFIX} /share/${PROJECT_NAME} CACHE STRING "Cppcheck files directory" )
99-
101+ string (LENGTH "${FILESDIR} " _filesdir_len)
102+ # override FILESDIR if it is set or empty
103+ if (FILESDIR OR ${_filesdir_len} EQUAL 0)
104+ # TODO: verify that it is an abolute path?
105+ set (FILESDIR_DEF ${FILESDIR} )
106+ else ()
107+ set (FILESDIR_DEF ${CMAKE_INSTALL_PREFIX} /share/${PROJECT_NAME} CACHE STRING "Cppcheck files directory" )
108+ endif ()
Original file line number Diff line number Diff line change @@ -95,6 +95,9 @@ if(USE_BOOST)
9595endif ()
9696message (STATUS "USE_LIBCXX = ${USE_LIBCXX} " )
9797message (STATUS )
98+ message (STATUS "FILESDIR = ${FILESDIR} " )
99+ message (STATUS "FILESDIR_DEF = ${FILESDIR_DEF} " )
100+ message (STATUS )
98101
99102if (${ANALYZE_ADDRESS} )
100103 message ("##########################################################" )
You can’t perform that action at this time.
0 commit comments