Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libconfig
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
libconfig
Commits
238b6f6d
Commit
238b6f6d
authored
Jan 10, 2021
by
Anonymous Maarten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: don't use CMAKE_SOURCE_DIR to enable building as subproject
parent
20f99db8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
12 deletions
+9
-12
examples/c++/CMakeLists.txt
examples/c++/CMakeLists.txt
+0
-5
examples/c/CMakeLists.txt
examples/c/CMakeLists.txt
+0
-4
lib/CMakeLists.txt
lib/CMakeLists.txt
+8
-0
tests/CMakeLists.txt
tests/CMakeLists.txt
+1
-3
No files found.
examples/c++/CMakeLists.txt
View file @
238b6f6d
...
...
@@ -9,11 +9,6 @@ add_executable(c++_example2 example2.cpp )
add_executable
(
c++_example3 example3.cpp
)
add_executable
(
c++_example4 example4.cpp
)
target_include_directories
(
c++_example1 PRIVATE
${
CMAKE_SOURCE_DIR
}
/lib
)
target_include_directories
(
c++_example2 PRIVATE
${
CMAKE_SOURCE_DIR
}
/lib
)
target_include_directories
(
c++_example3 PRIVATE
${
CMAKE_SOURCE_DIR
}
/lib
)
target_include_directories
(
c++_example4 PRIVATE
${
CMAKE_SOURCE_DIR
}
/lib
)
target_link_libraries
(
c++_example1
${
libname
}
++
)
target_link_libraries
(
c++_example2
${
libname
}
++
)
target_link_libraries
(
c++_example3
${
libname
}
++
)
...
...
examples/c/CMakeLists.txt
View file @
238b6f6d
...
...
@@ -8,10 +8,6 @@ add_executable(c_example1 example1.c )
add_executable
(
c_example2 example2.c
)
add_executable
(
c_example3 example3.c
)
target_include_directories
(
c_example1 PRIVATE
${
CMAKE_SOURCE_DIR
}
/lib
)
target_include_directories
(
c_example2 PRIVATE
${
CMAKE_SOURCE_DIR
}
/lib
)
target_include_directories
(
c_example3 PRIVATE
${
CMAKE_SOURCE_DIR
}
/lib
)
target_link_libraries
(
c_example1
${
libname
}
)
target_link_libraries
(
c_example2
${
libname
}
)
target_link_libraries
(
c_example3
${
libname
}
)
lib/CMakeLists.txt
View file @
238b6f6d
...
...
@@ -37,6 +37,14 @@ endif()
add_library
(
${
libname
}
${
libsrc
}
${
libinc
}
)
add_library
(
${
libname
}
++
${
libsrc_cpp
}
${
libinc_cpp
}
)
target_include_directories
(
${
libname
}
PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>
)
target_include_directories
(
${
libname
}
++ PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>
)
set_target_properties
(
${
libname
}
PROPERTIES LINKER_LANGUAGE C
PUBLIC_HEADER
"
${
libinc
}
"
)
...
...
tests/CMakeLists.txt
View file @
238b6f6d
...
...
@@ -4,8 +4,6 @@ else()
set
(
libname
"config"
)
endif
()
include_directories
(
${
CMAKE_SOURCE_DIR
}
/lib
)
add_executable
(
libconfig_tests
tests.c
)
...
...
@@ -18,5 +16,5 @@ target_link_libraries(libconfig_tests
add_test
(
NAME libconfig_tests
COMMAND libconfig_tests
WORKING_DIRECTORY
${
CMAKE
_SOURCE_DIR
}
/tests
WORKING_DIRECTORY
${
PROJECT
_SOURCE_DIR
}
/tests
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment