forked from HarbourMasters/Shipwright
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to cmake across all platforms (HarbourMasters#363)
- Loading branch information
Showing
63 changed files
with
5,852 additions
and
8,906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
################################################################################ | ||
# Command for variable_watch. This command issues error message, if a variable | ||
# is changed. If variable PROPERTY_READER_GUARD_DISABLED is TRUE nothing happens | ||
# variable_watch(<variable> property_reader_guard) | ||
################################################################################ | ||
function(property_reader_guard VARIABLE ACCESS VALUE CURRENT_LIST_FILE STACK) | ||
if("${PROPERTY_READER_GUARD_DISABLED}") | ||
return() | ||
endif() | ||
|
||
if("${ACCESS}" STREQUAL "MODIFIED_ACCESS") | ||
message(FATAL_ERROR | ||
" Variable ${VARIABLE} is not supposed to be changed.\n" | ||
" It is used only for reading target property ${VARIABLE}.\n" | ||
" Use\n" | ||
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}\" \"<value>\")\n" | ||
" or\n" | ||
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}_<CONFIG>\" \"<value>\")\n" | ||
" instead.\n") | ||
endif() | ||
endfunction() | ||
|
||
################################################################################ | ||
# Create variable <name> with generator expression that expands to value of | ||
# target property <name>_<CONFIG>. If property is empty or not set then property | ||
# <name> is used instead. Variable <name> has watcher property_reader_guard that | ||
# doesn't allow to edit it. | ||
# create_property_reader(<name>) | ||
# Input: | ||
# name - Name of watched property and output variable | ||
################################################################################ | ||
function(create_property_reader NAME) | ||
set(PROPERTY_READER_GUARD_DISABLED TRUE) | ||
set(CONFIG_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}_$<UPPER_CASE:$<CONFIG>>>>") | ||
set(IS_CONFIG_VALUE_EMPTY "$<STREQUAL:${CONFIG_VALUE},>") | ||
set(GENERAL_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}>>") | ||
set("${NAME}" "$<IF:${IS_CONFIG_VALUE_EMPTY},${GENERAL_VALUE},${CONFIG_VALUE}>" PARENT_SCOPE) | ||
variable_watch("${NAME}" property_reader_guard) | ||
endfunction() | ||
|
||
################################################################################ | ||
# Set property $<name>_${PROPS_CONFIG_U} of ${PROPS_TARGET} to <value> | ||
# set_config_specific_property(<name> <value>) | ||
# Input: | ||
# name - Prefix of property name | ||
# value - New value | ||
################################################################################ | ||
function(set_config_specific_property NAME VALUE) | ||
set_target_properties("${PROPS_TARGET}" PROPERTIES "${NAME}_${PROPS_CONFIG_U}" "${VALUE}") | ||
endfunction() | ||
|
||
################################################################################ | ||
|
||
create_property_reader("TARGET_NAME") | ||
create_property_reader("OUTPUT_DIRECTORY") | ||
|
||
set_config_specific_property("TARGET_NAME" "${PROPS_TARGET}") | ||
set_config_specific_property("OUTPUT_NAME" "${TARGET_NAME}") | ||
set_config_specific_property("ARCHIVE_OUTPUT_NAME" "${TARGET_NAME}") | ||
set_config_specific_property("LIBRARY_OUTPUT_NAME" "${TARGET_NAME}") | ||
set_config_specific_property("RUNTIME_OUTPUT_NAME" "${TARGET_NAME}") | ||
|
||
set_config_specific_property("ARCHIVE_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}") | ||
set_config_specific_property("LIBRARY_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}") | ||
set_config_specific_property("RUNTIME_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
include("${CMAKE_CURRENT_LIST_DIR}/Default.cmake") | ||
|
||
set_config_specific_property("OUTPUT_DIRECTORY" "${CMAKE_SOURCE_DIR}$<$<NOT:$<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>>:/${CMAKE_VS_PLATFORM_NAME}>/${PROPS_CONFIG}") | ||
|
||
if(MSVC) | ||
create_property_reader("DEFAULT_CXX_EXCEPTION_HANDLING") | ||
create_property_reader("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT") | ||
|
||
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL") | ||
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc") | ||
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) | ||
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0) | ||
set(CPACK_COMPONENTS_ALL "ship" "appimage") | ||
|
||
if (NOT CPACK_GENERATOR STREQUAL "External") | ||
list(REMOVE_ITEM CPACK_COMPONENTS_ALL "appimage") | ||
endif() | ||
|
||
if (CPACK_GENERATOR MATCHES "DEB|RPM") | ||
# https://unix.stackexchange.com/a/11552/254512 | ||
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/ship/bin")#/${CMAKE_PROJECT_VERSION}") | ||
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0) | ||
elseif (CPACK_GENERATOR MATCHES "ZIP") | ||
set(CPACK_PACKAGING_INSTALL_PREFIX "") | ||
endif() | ||
|
||
if (CPACK_GENERATOR MATCHES "External") | ||
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) | ||
SET(CPACK_MONOLITHIC_INSTALL 1) | ||
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/bin") | ||
endif() | ||
|
||
if (CPACK_GENERATOR MATCHES "Bundle") | ||
set(CPACK_BUNDLE_NAME "soh") | ||
set(CPACK_BUNDLE_PLIST "../soh/macosx/Info.plist") | ||
set(CPACK_BUNDLE_ICON "macosx/soh.icns") | ||
set(CPACK_BUNDLE_STARTUP_COMMAND "../soh/macosx/soh-macos.sh") | ||
set(CPACK_BUNDLE_APPLE_CERT_APP "-") | ||
endif() | ||
|
Oops, something went wrong.