diff options
Diffstat (limited to 'vendor.cmake')
-rw-r--r-- | vendor.cmake | 54 |
1 files changed, 21 insertions, 33 deletions
diff --git a/vendor.cmake b/vendor.cmake index 183dce9..b6e1819 100644 --- a/vendor.cmake +++ b/vendor.cmake @@ -1,44 +1,35 @@ ## Build configuration # Feel free to copy this file and change settings as you need. To use your own -# variant, use -DVENDOR=<path to your vendor.cmake> when generating the build +# variant, use -DVendor=<path to your vendor.cmake> when generating the build # script. -## Naming -# Executable name -set(poi_exe poi) -# Application name -set(poi_name "smolbote") +## Application +set(poi_exe "poi" CACHE STRING "Executable name") +set(poi_name "smolbote" CACHE STRING "Application name") ## Configuration paths, used in lib/configuration/defaults.h.in -if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - set(ConfigPath "smolbote.ini") - set(CrashdumpPath "crashes") - - set(FilterPath "hosts") - set(PluginsPath "plugins") - set(ProfilesPath "profiles") - - set(BookmarksPath "bookmarks.xbel") - set(DownloadsPath "~/Downloads") +if(UNIX) + set(PathPrefix "~/.config/smolbote") else() - set(ConfigPath "~/.config/smolbote/smolbote.cfg") - set(CrashdumpPath "~/.config/smolbote/crash.d") + set(PathPrefix ".") +endif() - set(FilterPath "~/.config/smolbote/hosts.d") - set(PluginsPath "~/.config/smolbote/plugins.d") - set(ProfilesPath "~/.config/smolbote/profiles.d") +set(Path_Config "${PathPrefix}/smolbote.cfg" CACHE STRING "Configuration location") +set(Path_Crashdump "${PathPrefix}/crash.d" CACHE STRING "Crash dump location") - set(BookmarksPath "~/.config/smolbote/bookmarks.xbel") - set(DownloadsPath "~/Downloads") -endif() +set(Path_Filter "${PathPrefix}/hosts.d" CACHE STRING "Host path location") +set(Path_Plugins "${PathPrefix}/plugins.d" CACHE STRING "Plugin load location") +set(Path_Profiles "${PathPrefix}/profiles.d" CACHE STRING "Profile load location") +set(Path_Bookmarks "${PathPrefix}/bookmarks.xbel" CACHE STRING "Bookmark location") +set(Path_Downloads "~/Downloads" CACHE STRING "Download location") ## Install Paths # Binaries will be installed to ${CMAKE_INSTALL_PREFIX}/${installPath_bin} set(installPath_bin bin) # Plugins will be installed to ${CMAKE_INSTALL_PREFIX}/${installPath_plugin} -if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") +if(WIN32) set(installPath_plugin bin/plugins) else() set(installPath_plugin lib/smolbote) @@ -48,18 +39,15 @@ endif() if (EXISTS "${PROJECT_SOURCE_DIR}/.git") execute_process(COMMAND git rev-list --count HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VerRevision OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VerShortId OUTPUT_STRIP_TRAILING_WHITESPACE) - set(VerTag "r${VerRevision}") - set(VerDescribe "r${VerRevision}-${VerShortId}") execute_process(COMMAND git rev-parse HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VerCommit OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND git rev-parse --abbrev-ref HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VerBranch OUTPUT_STRIP_TRAILING_WHITESPACE) -else() - message(FATAL_ERROR "Cannot find repository metadata. Please set version information in vendor.cmake") - #set(VerTag "0.2.2") - #set(VerDescribe "0.2.2-unknown") - #set(VerCommit "00000000") - #set(VerBranch "unknown") endif() +set(poi_Version "r${VerRevision}" CACHE STRING "Short version string") +set(poi_Describe "r${VerRevision}-${VerShortId}" CACHE STRING "Long version string") +set(poi_Build "${VerBranch}-${VerCommit}" CACHE STRING "Build string") + + if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -O2") |