Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
IHTACMakeCommon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IHTA
CMake
IHTACMakeCommon
Commits
9870b093
Commit
9870b093
authored
2 years ago
by
Pascal Palenda
Browse files
Options
Downloads
Patches
Plain Diff
Add common settings for initializing a project
parent
555a8834
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Index.cmake
+2
-0
2 additions, 0 deletions
src/Index.cmake
src/InitProject.cmake
+33
-0
33 additions, 0 deletions
src/InitProject.cmake
with
35 additions
and
0 deletions
src/Index.cmake
+
2
−
0
View file @
9870b093
...
...
@@ -2,6 +2,8 @@ cmake_minimum_required (VERSION 3.20 FATAL_ERROR)
include_guard
()
include
(
${
CMAKE_CURRENT_LIST_DIR
}
/InitProject.cmake
)
# Check for CPM
file
(
GLOB CPM_MODULE_LOCATION
${
CMAKE_BINARY_DIR
}
/cmake/CPM*.cmake
)
...
...
This diff is collapsed.
Click to expand it.
src/InitProject.cmake
0 → 100644
+
33
−
0
View file @
9870b093
include_guard
()
# init_project
#
# Sets common settings for a project. These include:
#
# - all debug builds will have the postfix `-d`
# - the default install directory will be `${CMAKE_CURRENT_BINARY_DIR}/dist`
# - all output directories will include the current configuration
# - IDE folders will be turned on for visual studio
macro
(
init_project
)
set
(
CMAKE_DEBUG_POSTFIX
"-d"
)
# Set the install root folder if not specified by the user
if
(
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
)
set
(
CMAKE_INSTALL_PREFIX
${
CMAKE_CURRENT_BINARY_DIR
}
/dist
CACHE PATH
"Install root directory"
FORCE
)
set
(
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OFF
)
endif
(
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
)
if
(
NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY AND WIN32
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/$<CONFIG>/bin
)
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/$<CONFIG>/lib
)
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/$<CONFIG>/lib
)
endif
()
if
(
CMAKE_GENERATOR MATCHES
"Visual Studio"
)
set_property
(
GLOBAL PROPERTY USE_FOLDERS ON
)
endif
()
endmacro
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment