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
d0710179
Commit
d0710179
authored
2 years ago
by
Pascal Palenda
Browse files
Options
Downloads
Patches
Plain Diff
Add the creaton of the object library
parent
af1faa26
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/IhtaAddLibrary.cmake
+32
-1
32 additions, 1 deletion
src/IhtaAddLibrary.cmake
with
32 additions
and
1 deletion
src/IhtaAddLibrary.cmake
+
32
−
1
View file @
d0710179
...
@@ -70,7 +70,38 @@ macro (ihta_add_library)
...
@@ -70,7 +70,38 @@ macro (ihta_add_library)
endif
()
endif
()
if
(
IHTA_ADD_LIB_TEST_INPLACE OR IHTA_ADD_LIB_TEST_INTERNALS
)
if
(
IHTA_ADD_LIB_TEST_INPLACE OR IHTA_ADD_LIB_TEST_INTERNALS
)
# todo
set
(
IHTA_ADD_LIB_TARGET
${
IHTA_ADD_LIB_NAME
}${
IHTA_ADD_LIB_OBJECT_LIB_POSTFIX
}
)
# Create an object library
add_library
(
${
IHTA_ADD_LIB_TARGET
}
OBJECT
""
)
target_sources
(
${
IHTA_ADD_LIB_TARGET
}
PRIVATE
${
IHTA_ADD_LIB_SOURCES
}
)
# Add compile definition for the export header generated by cmake's generate_export_header. For example used in packageProject.
if
(
${
IHTA_ADD_LIB_LIBRARY_TYPE
}
MATCHES
"STATIC"
)
target_compile_definitions
(
${
IHTA_ADD_LIB_TARGET
}
PUBLIC
${
IHTA_ADD_LIB_NAME
}
_STATIC_DEFINE
)
else
()
target_compile_definitions
(
${
IHTA_ADD_LIB_TARGET
}
PUBLIC
${
IHTA_ADD_LIB_NAME
}
_EXPORTS
)
endif
()
# Add the actual library target
add_library
(
${
IHTA_ADD_LIB_NAME
}
${
IHTA_ADD_LIB_LIBRARY_TYPE
}
$<TARGET_OBJECTS:
${
IHTA_ADD_LIB_TARGET
}
>
)
add_library
(
${
IHTA_ADD_LIB_NAMESPACE
}
::
${
IHTA_ADD_LIB_NAME
}
ALIAS
${
IHTA_ADD_LIB_NAME
}
)
# Include Directory
target_include_directories
(
${
IHTA_ADD_LIB_NAME
}
PUBLIC $<BUILD_INTERFACE:
${
IHTA_ADD_LIB_INCLUDE_DIR
}
>
$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
/
${
IHTA_ADD_LIB_INSTALL_INCLUDE_DIR
}
>
)
# Required compiler features
target_compile_features
(
${
IHTA_ADD_LIB_NAME
}
PUBLIC cxx_std_17
)
# If build out of parent project, add parent folder library to parent project folder
if
(
NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR
)
set_property
(
TARGET
${
IHTA_ADD_LIB_NAME
}
PROPERTY FOLDER
${
IHTA_ADD_LIB_IDE_FOLDER
}
)
endif
()
else
()
else
()
set
(
IHTA_ADD_LIB_TARGET
${
IHTA_ADD_LIB_NAME
}
)
set
(
IHTA_ADD_LIB_TARGET
${
IHTA_ADD_LIB_NAME
}
)
...
...
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