summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLutz Bichler <Lutz.Bichler@bmw.de>2014-09-24 12:14:48 +0200
committerLutz Bichler <Lutz.Bichler@bmw.de>2014-09-24 12:14:48 +0200
commitbcb5ab22e31020b365ae5c6916aef7f7bca9610e (patch)
tree5da66e4e5c088d6a6ede4957cd9db07af6a6063a
parent0fc473ebd8c17e77f2a12a84d5c1a6567483b6a9 (diff)
downloadvSomeIP-bcb5ab22e31020b365ae5c6916aef7f7bca9610e.tar.gz
[PATCH 1/8] CMakeLists.txt: allow in-source and out-of-source builds
The current CMakeLists.txt file assumes that the project is built within the source directory, e.g., in a subdirectory build (called in-source build). When the user chooses the build directory to be at a different location not within the source directory (called out-of-source build), make fails with: Linking CXX shared library libvsomeip.so /usr/bin/ld: cannot open linker script file ../exportmap.gcc: No such file or directory This commit changes the path of the exportmap.gcc to refer to the source directory with the standard CMake variable CMAKE_CURRENT_SOURCE_DIR [1], and this now allows in-source and out-of-source builds. The issue was discovered while creating a bitbake recipe for the vSomeIP library. In recent versions of OpenEmbedded-Core/Yocto Poky, the default build configuration for CMake projects are out-of-source builds. Hence, this change in the CMakeLists.txt allows us to use this default build configuration in the recipe without any further ado. [1] http://www.cmake.org/Wiki/CMake_Useful_Variables Signed-off-by: Lukas Bulwahn, BMW Car IT GmbH <Lukas.Bulwahn@bmw.de>
-rw-r--r--CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 880cccb..3116706 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,7 +37,7 @@ endforeach ()
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(OS "LINUX")
set(DL_LIBRARY "dl")
- set(EXPORTSYMBOLS "-Wl,-export-dynamic -Wl,--version-script=../exportmap.gcc")
+ set(EXPORTSYMBOLS "-Wl,-export-dynamic -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exportmap.gcc")
set(NO_DEPRECATED "")
set(OPTIMIZE "")
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")