Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
e1231b9b
Commit
e1231b9b
authored
Jul 12, 2012
by
Sebastian Eichelbaum
Browse files
[FIX
#184
] Cmake now explicitly links against libstdc++ and libm
parent
59218af8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
src/core/CMakeLists.txt
src/core/CMakeLists.txt
+1
-1
tools/cmake/OpenWalnut.cmake
tools/cmake/OpenWalnut.cmake
+4
-0
tools/cmake/OpenWalnutUtils.cmake
tools/cmake/OpenWalnutUtils.cmake
+2
-2
No files found.
src/core/CMakeLists.txt
View file @
e1231b9b
...
@@ -44,7 +44,7 @@ COLLECT_COMPILE_FILES( "${CMAKE_CURRENT_SOURCE_DIR}" TARGET_CPP_FILES TARGET_H_F
...
@@ -44,7 +44,7 @@ COLLECT_COMPILE_FILES( "${CMAKE_CURRENT_SOURCE_DIR}" TARGET_CPP_FILES TARGET_H_F
# Setup the target
# Setup the target
ADD_LIBRARY
(
${
LibName
}
SHARED
${
TARGET_CPP_FILES
}
${
TARGET_H_FILES
}
${
OW_VERSION_HEADER
}
)
ADD_LIBRARY
(
${
LibName
}
SHARED
${
TARGET_CPP_FILES
}
${
TARGET_H_FILES
}
${
OW_VERSION_HEADER
}
)
TARGET_LINK_LIBRARIES
(
${
LibName
}
${
Boost_LIBRARIES
}
${
CMAKE_DL_LIBS
}
${
OPENGL_gl_LIBRARY
}
${
OPENSCENEGRAPH_LIBRARIES
}
TARGET_LINK_LIBRARIES
(
${
LibName
}
${
Boost_LIBRARIES
}
${
CMAKE_STANDARD_LIBRARIES
}
${
CMAKE_DL_LIBS
}
${
OPENGL_gl_LIBRARY
}
${
OPENSCENEGRAPH_LIBRARIES
}
)
)
# Tell CMake that someone creates this file for us. See doc of SETUP_VERSION_HEADER for details why this is needed.
# Tell CMake that someone creates this file for us. See doc of SETUP_VERSION_HEADER for details why this is needed.
...
...
tools/cmake/OpenWalnut.cmake
View file @
e1231b9b
...
@@ -167,6 +167,10 @@ FUNCTION( BUILD_SYSTEM_COMPILER )
...
@@ -167,6 +167,10 @@ FUNCTION( BUILD_SYSTEM_COMPILER )
SET
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-g -DDEBUG -O2"
CACHE STRING
""
FORCE
)
SET
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-g -DDEBUG -O2"
CACHE STRING
""
FORCE
)
ENDFUNCTION
(
BUILD_SYSTEM_COMPILER
)
ENDFUNCTION
(
BUILD_SYSTEM_COMPILER
)
# GCC 4.7 requires us to explicitly link against libstdc++ and libm. CMake offers a variable for this called "CMAKE_STANDARD_LIBRARIES".
# Unfortunately, this variable is empty. We fill it here and hopefully this is fixed in the near future.
LIST
(
APPEND CMAKE_STANDARD_LIBRARIES
"stdc++"
"m"
)
# Allow injection of other flags
# Allow injection of other flags
# NOTE: do not set these variables somewhere in cmake. They are intended to be used when calling CMake from the command line.
# NOTE: do not set these variables somewhere in cmake. They are intended to be used when calling CMake from the command line.
# Utilize this to append build flags from external systems (like dpkg-buildflags).
# Utilize this to append build flags from external systems (like dpkg-buildflags).
...
...
tools/cmake/OpenWalnutUtils.cmake
View file @
e1231b9b
...
@@ -150,7 +150,7 @@ FUNCTION( SETUP_TESTS _TEST_FILES _TEST_TARGET )
...
@@ -150,7 +150,7 @@ FUNCTION( SETUP_TESTS _TEST_FILES _TEST_TARGET )
# create the test-target
# create the test-target
CXXTEST_ADD_TEST
(
${
UnitTestName
}
"
${
UnitTestName
}
.cc"
${
testfile
}
)
CXXTEST_ADD_TEST
(
${
UnitTestName
}
"
${
UnitTestName
}
.cc"
${
testfile
}
)
TARGET_LINK_LIBRARIES
(
${
UnitTestName
}
${
_TEST_TARGET
}
${
_DEPENDENCIES
}
)
TARGET_LINK_LIBRARIES
(
${
UnitTestName
}
${
_TEST_TARGET
}
${
CMAKE_STANDARD_LIBRARIES
}
${
_DEPENDENCIES
}
)
# unfortunately, the tests search their fixtures relative to their working directory. So we add a preprocessor define containing the
# unfortunately, the tests search their fixtures relative to their working directory. So we add a preprocessor define containing the
# path to the fixtures. This is quite ugly but I do not know how to ensure that the working directory of tests can be modified.
# path to the fixtures. This is quite ugly but I do not know how to ensure that the working directory of tests can be modified.
...
@@ -670,7 +670,7 @@ FUNCTION( SETUP_MODULE _MODULE_NAME _MODULE_SOURCE_DIR _MODULE_DEPENDENCIES _MOD
...
@@ -670,7 +670,7 @@ FUNCTION( SETUP_MODULE _MODULE_NAME _MODULE_SOURCE_DIR _MODULE_DEPENDENCIES _MOD
# Setup the target
# Setup the target
ADD_LIBRARY
(
${
MODULE_NAME
}
SHARED
${
TARGET_CPP_FILES
}
${
TARGET_H_FILES
}
)
ADD_LIBRARY
(
${
MODULE_NAME
}
SHARED
${
TARGET_CPP_FILES
}
${
TARGET_H_FILES
}
)
TARGET_LINK_LIBRARIES
(
${
MODULE_NAME
}
${
OW_LIB_OPENWALNUT
}
${
Boost_LIBRARIES
}
${
OPENGL_gl_LIBRARY
}
${
OPENSCENEGRAPH_LIBRARIES
}
${
_MODULE_DEPENDENCIES
}
)
TARGET_LINK_LIBRARIES
(
${
MODULE_NAME
}
${
CMAKE_STANDARD_LIBRARIES
}
${
OW_LIB_OPENWALNUT
}
${
Boost_LIBRARIES
}
${
OPENGL_gl_LIBRARY
}
${
OPENSCENEGRAPH_LIBRARIES
}
${
_MODULE_DEPENDENCIES
}
)
# Set the version of the library.
# Set the version of the library.
SET_TARGET_PROPERTIES
(
${
MODULE_NAME
}
PROPERTIES
SET_TARGET_PROPERTIES
(
${
MODULE_NAME
}
PROPERTIES
...
...
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