Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake ADD_EXECUTABLE([WIN32] [MACOSX_BUNDLE]) properties #226

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6f63d59
TriBITS #17 Adding mercurial and subversion support in clone_extra_re…
lefebvre Nov 4, 2015
5e33e6d
TriBITS #17: Updating TribitsCTestDriverCore and TribitsProcessExtraR…
lefebvre Nov 6, 2015
2bd60aa
TriBITS #94 Allowing for CTEST_BUILD_TARGET override in TribitsCTESTD…
lefebvre Nov 12, 2015
3f6cc8d
Merging TriBITS #98 fix into mercurial_support
Nov 24, 2015
5628206
TriBITS #98: Fixing clone_extra_repos.py split('\n') with platform ag…
lefebvre Nov 24, 2015
303d056
Merge remote-tracking branch 'origin/master' into mercurial_support
lefebvre Nov 24, 2015
2efd83c
Merge remote-tracking branch 'tribits/master'
lefebvre Nov 25, 2015
c0e9963
Merge branch 'master' into mercurial_support
lefebvre Nov 25, 2015
be70c7a
Fixing MACRO(QUEUE_ERROR) defining it before use of macro. Windows cm…
lefebvre Jan 4, 2016
8a92686
TriBITS #19: Updating TribitsCTestDriverCore to support mercurial roo…
lefebvre Jan 5, 2016
acd84d9
TriBITS #77 Fixing issue where CMake doesn't find git on windows.
lefebvre Jan 5, 2016
cd798be
Merge https://github.com/TriBITSPub/TriBITS
lefebvre May 19, 2016
3ceea00
Merge https://github.com/TriBITSPub/TriBITS
Jun 9, 2016
89e8a9e
Merge https://github.com/TriBITSPub/TriBITS
lefebvre Nov 7, 2016
ab8a449
Replacing symlink Version.cmake with copy of tribits/Version.cmake.
Nov 9, 2016
75c11bc
Merge https://github.com/TriBITSPub/TriBITS
lefebvre Feb 6, 2017
62c6346
Merge https://github.com/TriBITSPub/TriBITS
lefebvre May 31, 2017
23cf0e0
Merge https://github.com/TriBITSPub/TriBITS
lefebvre Sep 20, 2017
6437dd1
Adding native cmake add_executable arguments (WIN32,MACOSX_BUNDLE) to…
lefebvre Sep 20, 2017
7a3e199
Correcting set_target_properties syntax.
lefebvre Sep 20, 2017
d558c13
Updating TRIBITS to support Windows BUILD_SHARED_LIBS=ON
lefebvre Nov 6, 2017
6e7f77c
Merge branch 'master' of https://github.com/lefebvre/TriBITS
lefebvre Nov 6, 2017
45a6ab1
Updating EXECUTABLE_PATH logic with CMAKE_RUNTIME_OUTPUT_DIRECTORY wh…
lefebvre Nov 7, 2017
f67e40a
Updating print statement for Python3 compatibility.
pshriwise Sep 30, 2021
b5721b2
Merge pull request #2 from pshriwise/print_fix
lefebvre Oct 2, 2021
4a9c5d4
Remove exraneous compiled libraries
lefebvrera Oct 25, 2023
4dba8aa
Merge pull request #3 from lefebvrera/remove-test-core-libs
lefebvre Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
Empty file.
Empty file.
27 changes: 15 additions & 12 deletions tribits/ci_support/clone_extra_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@


def injectCmndLineOptionsInParser(clp, gitoliteRootDefault=""):

clp.add_option(
"--extra-repos", dest="extraRepos", type="string", default="",
help="List of names of extra repos to be cloned <extra-repos>" \
Expand All @@ -137,12 +137,12 @@ def injectCmndLineOptionsInParser(clp, gitoliteRootDefault=""):
" will be selected. But the repos listed in <extra-repos> must always" \
" be a subset of the repos of type <extra-repos-type> selected from" \
" <extra-repos-file>. (Default '')" )

clp.add_option(
"--not-extra-repos", dest="notExtraRepos", type="string", default="",
help="List of names of extra repos *NOT* to clone (i.e. \"repo0,repo1,...\")." \
" (Default '')" )

clp.add_option(
"--extra-repos-file", dest="extraReposFile", type="string",
default=g_extraRerposFileDefault,
Expand All @@ -157,7 +157,7 @@ def injectCmndLineOptionsInParser(clp, gitoliteRootDefault=""):
"<extra-repos-file>. When --extra-repos is set, then this argument" \
" is ignored.",
clp )

clp.add_option(
"--gitolite-root", dest="gitoliteRoot", type="string", default=gitoliteRootDefault,
help="Gives the root for a gitolite repos <gitolite-root> (e.g. git@<some-url>)." \
Expand Down Expand Up @@ -199,13 +199,13 @@ def injectCmndLineOptionsInParser(clp, gitoliteRootDefault=""):
"--no-op", dest="doOp", action="store_false",
help="Skip cloning the repos and just show the clone commands.",
default=True )

clp.add_option(
"--create-gitdist-file", dest="createGitdistFile", type="string", default="",
help="If specified, the file <gitdist-file> will get generated with the list" \
" of git repos (the same list that is cloned with --do-clone)." \
" (Default = '')")

clp.add_option(
"--show-defaults", dest="showDefaults", action="store_true",
help="Show the default option values and do nothing at all.",
Expand Down Expand Up @@ -247,7 +247,7 @@ def fwdCmndLineOptions(inOptions, terminator=""):
cmndLineOpts += " --no-op" + terminator
cmndLineOpts += \
" --create-gitdist-file='"+inOptions.createGitdistFile+"'"+terminator
return cmndLineOpts
return cmndLineOpts


def echoCmndLineOptions(inOptions):
Expand Down Expand Up @@ -403,7 +403,7 @@ def getExtraReposTable(extraRepoDictList):
{ "label":"Category", "align":"L", "fields":repoCategoryList },
]
#print("extraReposTableDictList =", extraReposTableDictList)

extraReposTable = gitdist.createAsciiTable(extraReposTableDictList)

# Return the table
Expand All @@ -424,6 +424,9 @@ def cloneExtraRepo(inOptions, extraRepoDict):
repoDir = extraRepoDict["DIR"]
repoUrl = extraRepoDict["REPOURL"]
repoVcType = extraRepoDict["REPOTYPE"]
commandMap = { "GIT":"git clone"
,"HG" :"hg clone"
,"SVN":"svn co"}
verbLevelIsMinimum = isVerbosityLevel(inOptions, "minimal")
if verbLevelIsMinimum:
print("\nCloning repo " + repoName + " ...")
Expand All @@ -432,10 +435,10 @@ def cloneExtraRepo(inOptions, extraRepoDict):
print("\n ==> Repo dir = '" + repoDir +
"' already exists. Skipping clone!")
return
if repoVcType != "GIT":
if not repoVcType in commandMap:
print("\n ==> ERROR: Repo type '"+repoVcType+"' not supported!")
sys.exit(1)
cmnd = "git clone "+repoUrl+" "+repoDir
cmnd = commandMap[repoVcType]+" "+repoUrl+" "+repoDir
if inOptions.doOp:
echoRunSysCmnd(cmnd, timeCmnd=True, verbose=verbLevelIsMinimum)
elif verbLevelIsMinimum:
Expand Down Expand Up @@ -463,7 +466,7 @@ def cloneExtraRepos(inOptions):
#
# B) Get the list of gitolite repos
#

if inOptions.gitoliteRoot:
if verbLevelIsMinimal:
print("\n***")
Expand Down Expand Up @@ -507,7 +510,7 @@ def cloneExtraRepos(inOptions):
print("\n***")
print("*** List of selected extra repos to clone:")
print("***\n")

extraReposTable = getExtraReposTable(extraRepoDictList)
print(extraReposTable)

Expand Down
26 changes: 23 additions & 3 deletions tribits/core/package_arch/TribitsAddExecutable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ INCLUDE(CMakeParseArguments)
# [LINKER_LANGUAGE (C|CXX|Fortran)]
# [TARGET_DEFINES -D<define0> -D<define1> ...]
# [INSTALLABLE]
# [WIN32]
# [MACOSX_BUNDLE]
# [ADDED_EXE_TARGET_NAME_OUT <exeTargetName>]
# )
#
Expand Down Expand Up @@ -247,6 +249,16 @@ INCLUDE(CMakeParseArguments)
# executable into the ``${CMAKE_INSTALL_PREFIX}/bin/`` directory (see
# `Install Target (TRIBITS_ADD_EXECUTABLE())`_).
#
# ``WIN32``
#
# If passed in, then the property WIN32_EXECUTABLE will be set on the target
# created. This makes it a GUI executable instead of a console application.
#
# ``MACOSX_BUNDLE``
#
# If passed in, the corresponding property will be set on the created target.
# This makes a GUI application that can be launched from the finder.
#
# ``ADDED_EXE_TARGET_NAME_OUT <exeTargetName>``
#
# If specified, then on output the variable ``<exeTargetName>`` will be
Expand Down Expand Up @@ -334,11 +346,11 @@ FUNCTION(TRIBITS_ADD_EXECUTABLE EXE_NAME)
MESSAGE("")
MESSAGE("TRIBITS_ADD_EXECUTABLE: ${EXE_NAME} ${ARGN}")
ENDIF()

#
# Confirm that TRIBITS_PACKAGE() was called prior to adding executable
#

IF(NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_CALLED)
MESSAGE(FATAL_ERROR "Must call TRIBITS_PACKAGE() before TRIBITS_ADD_EXECUTABLE() in ${TRIBITS_PACKAGE_CMAKELIST_FILE}")
ENDIF()
Expand All @@ -355,7 +367,7 @@ FUNCTION(TRIBITS_ADD_EXECUTABLE EXE_NAME)
#prefix
PARSE
#options
"NOEXEPREFIX;NOEXESUFFIX;ADD_DIR_TO_NAME;INSTALLABLE"
"NOEXEPREFIX;NOEXESUFFIX;ADD_DIR_TO_NAME;INSTALLABLE;WIN32;MACOSX_BUNDLE"
#one_value_keywords
""
#multi_value_keywords
Expand Down Expand Up @@ -532,6 +544,14 @@ FUNCTION(TRIBITS_ADD_EXECUTABLE EXE_NAME)
ADD_EXECUTABLE(${EXE_BINARY_NAME} ${EXE_SOURCES})
APPEND_GLOBAL_SET(${PARENT_PACKAGE_NAME}_ALL_TARGETS ${EXE_BINARY_NAME})

IF(PARSE_WIN32)
SET_TARGET_PROPERTIES(${EXE_BINARY_NAME} PROPERTIES WIN32_EXECUTABLE TRUE)
ENDIF()

IF(PARSE_MACOSX_BUNDLE)
SET_TARGET_PROPERTIES(${EXE_BINARY_NAME} PROPERTIES MACOSX_BUNDLE TRUE)
ENDIF()

IF(PARSE_ADDED_EXE_TARGET_NAME_OUT)
SET(${PARSE_ADDED_EXE_TARGET_NAME_OUT} ${EXE_BINARY_NAME} PARENT_SCOPE)
ENDIF()
Expand Down
8 changes: 8 additions & 0 deletions tribits/core/package_arch/TribitsAddTestHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,14 @@ FUNCTION(TRIBITS_ADD_TEST_ADJUST_DIRECTORY EXE_BINARY_NAME DIRECTORY
ENDIF()

ENDIF()
IF(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
SET(ADJUSTED_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXE_BINARY_NAME}")
IF(CMAKE_GENERATOR MATCHES "Visual" OR CMAKE_GENERATOR MATCHES "XCode")
SET(ADJUSTED_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${EXE_BINARY_NAME}")
ENDIF()
MESSAGE(STATUS "Overriding ${EXE_BINARY_NAME} path with CMAKE_RUNTIME_OUTPUT_DIRECTORY(${ADJUSTED_PATH})")
SET(EXECUTABLE_PATH "${ADJUSTED_PATH}")
ENDIF()

SET(${EXECUTABLE_PATH_OUT} ${EXECUTABLE_PATH} PARENT_SCOPE)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ FUNCTION(TRIBITS_PARSE_EXTRAREPO_PACKSTAT PACKSTAT_IN

#PRINT_VAR(PACKSTAT_IN)
SPLIT("${PACKSTAT_IN}" "," PACKSTAT_IN_ARRAY)

# Set the defaults
SET(HASPKGS "HASPACKAGES")
SET(PREPOST "POST")
Expand All @@ -229,7 +229,7 @@ FUNCTION(TRIBITS_PARSE_EXTRAREPO_PACKSTAT PACKSTAT_IN
MESSAGE_WRAPPER(FATAL_ERROR "Error, the value of 'PACKSTAT' element"
" '${PACKSTAT_ELE}' is not valid! Valid choices are '' (empty),"
" 'HASPACKAGES', 'NOPACKAGES', 'PRE', and 'POST'. The defaults if all"
" fields are empty are 'HASPACKAGES' and 'POST'")
" fields are empty are 'HASPACKAGES' and 'POST'")
ENDIF()
ENDFOREACH()
# NOTE: In the above FOREACH(PACKSTAT_ELE ${PACKSTAT_IN_ARRAY}) loop, empty
Expand Down Expand Up @@ -353,7 +353,7 @@ MACRO(TRIBITS_PROCESS_EXTRAREPOS_LISTS)
# Okay
ELSEIF (EXTRAREPO_VCTYPE STREQUAL HG)
# not quite okay
MESSAGE(WARNING "Warning: the repo ${EXTRAREPO_NAME} is a Mercurial repo: these are tolerated, but not fully supported.")
MESSAGE("NOTICE: the repo ${EXTRAREPO_NAME} is a Mercurial repo: these are tolerated, but not fully supported.")
ELSEIF (EXTRAREPO_VCTYPE STREQUAL "")
# We are okay with no VC type
ELSE()
Expand Down Expand Up @@ -404,7 +404,7 @@ MACRO(TRIBITS_PROCESS_EXTRAREPOS_LISTS)
" specified in the PACKSTAT field '${EXTRAREPO_PACKSTAT}' came directly after"
" a 'POST' extra repo! All 'PRE' extra repos must be listed before all"
" 'POST' extra repos!"
)
)
ENDIF()

# B.2) Unconditionally add the extrarepo to the list
Expand Down Expand Up @@ -613,7 +613,7 @@ FUNCTION(TRIBITS_FILTER_OR_ASSERT_EXTRA_REPOS)
IF (TRIBITS_PROCESS_EXTRAREPOS_LISTS_DEBUG)
PRINT_VAR(${PROJECT_NAME}_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE)
ENDIF()

IF (${PROJECT_NAME}_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE STREQUAL "Continuous" AND
EXTRAREPO_CATEGORY STREQUAL "Continuous"
)
Expand Down