Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
f5d2ad65
Commit
f5d2ad65
authored
14 years ago
by
Andreas Schenk
Browse files
Options
Downloads
Patches
Plain Diff
moved stage setup and compiler flag setup to macros in OST.cmake
parent
1248a3ef
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+4
-60
4 additions, 60 deletions
CMakeLists.txt
cmake_support/OST.cmake
+68
-19
68 additions, 19 deletions
cmake_support/OST.cmake
deployment/CMakeLists.txt
+2
-1
2 additions, 1 deletion
deployment/CMakeLists.txt
with
74 additions
and
80 deletions
CMakeLists.txt
+
4
−
60
View file @
f5d2ad65
...
...
@@ -124,70 +124,14 @@ if (NOT CMAKE_BUILD_TYPE)
set
(
CMAKE_BUILD_TYPE Debug
)
endif
()
set
(
STAGE_DIR
"
${
CMAKE_BINARY_DIR
}
/stage"
)
set
(
EXECUTABLE_OUTPUT_PATH
${
STAGE_DIR
}
/bin
)
set
(
HEADER_STAGE_PATH
${
STAGE_DIR
}
/include
)
set
(
LIBEXEC_STAGE_PATH
${
STAGE_DIR
}
/libexec/openstructure
)
set
(
SHARED_DATA_PATH
${
STAGE_DIR
}
/share/openstructure
)
include_directories
(
"
${
HEADER_STAGE_PATH
}
"
)
link_directories
(
${
LIB_STAGE_PATH
}
)
if
(
UNIX AND NOT APPLE
)
check_architecture
()
endif
()
set
(
ARCH
${
CMAKE_NATIVE_ARCH
}
)
if
(
"
${
ARCH
}
"
MATCHES
"64"
)
set
(
LIB_DIR lib64
)
set
(
LIB_STAGE_PATH
"
${
STAGE_DIR
}
/lib64"
)
else
()
set
(
LIB_DIR lib
)
set
(
LIB_STAGE_PATH
"
${
STAGE_DIR
}
/lib"
)
endif
()
file
(
MAKE_DIRECTORY
${
STAGE_DIR
}
${
EXECUTABLE_OUTPUT_PATH
}
setup_stage
()
file
(
MAKE_DIRECTORY
${
STAGE_DIR
}
${
EXECUTABLE_OUTPUT_PATH
}
${
HEADER_STAGE_PATH
}
${
LIB_STAGE_PATH
}
${
LIBEXEC_STAGE_PATH
}
)
if
(
WIN32
)
# add_definitions(-DBOOST_TEST_INCLUDED)
add_definitions
(
-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE -DNOMINMAX
)
add_definitions
(
-Zc:wchar_t-
)
#
# add_definitions(-MDd -vmg -EHsc -GR)
#GR:Uses the __fastcall calling convention (x86 only).
#-EHsc to specify the synchronous exception handling mode/
#-vmg Uses full generality for pointers to members.
add_definitions
(
-DBOOST_ZLIB_BINARY=zdll
)
#add_definitions(-NODEFAULTLIB:LIBCMTD.lib)
endif
()
function
(
get_compiler_version _OUTPUT_VERSION
)
exec_program
(
${
CMAKE_CXX_COMPILER
}
ARGS
${
CMAKE_CXX_COMPILER_ARG1
}
-dumpversion
OUTPUT_VARIABLE _COMPILER_VERSION
)
string
(
REGEX REPLACE
"([0-9])
\\
.([0-9])(
\\
.[0-9])?"
"
\\
1
\\
2"
_COMPILER_VERSION
${
_COMPILER_VERSION
}
)
set
(
${
_OUTPUT_VERSION
}
${
_COMPILER_VERSION
}
PARENT_SCOPE
)
endfunction
()
if
(
CMAKE_COMPILER_IS_GNUCXX
)
get_compiler_version
(
_GCC_VERSION
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall"
)
if
(
_GCC_VERSION MATCHES
"44"
)
# gcc 4.4. is very strict about aliasing rules. the shared_count
# implementation that is used boost's shared_ptr violates these rules. To
# silence the warnings and prevent miscompiles, enable
# -fno-strict-aliasing
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fno-strict-aliasing"
)
endif
()
endif
()
setup_compiler_flags
()
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
)
set
(
_BOOST_MIN_VERSION 1.37
)
...
...
This diff is collapsed.
Click to expand it.
cmake_support/OST.cmake
+
68
−
19
View file @
f5d2ad65
...
...
@@ -691,25 +691,74 @@ int main( int argc, char ** argv ) {
endmacro
()
macro
(
get_ost_rev
)
if
(
NOT OST_REV
)
if
(
NOT WIN32
)
if
(
EXISTS .svn
)
exec_program
(
"svn"
ARGS
"info |grep Revision|awk '{print $2}'"
OUTPUT_VARIABLE OST_REV
)
endif
()
else
()
exec_program
(
"svnversion.exe"
ARGS
""
OUTPUT_VARIABLE OST_REV
)
string
(
REGEX REPLACE
"[0-9][0-9][0-9][0-9]:"
""
OST_REV
${
OST_REV
}
)
string
(
REGEX REPLACE
"[A-Za-z]"
""
OST_REV
${
OST_REV
}
)
endif
()
#-------------------------------------------------------------------------------
# this macro sets up the stage directories
#-------------------------------------------------------------------------------
macro
(
setup_stage
)
set
(
STAGE_DIR
"
${
CMAKE_BINARY_DIR
}
/stage"
)
set
(
EXECUTABLE_OUTPUT_PATH
${
STAGE_DIR
}
/bin
)
set
(
HEADER_STAGE_PATH
${
STAGE_DIR
}
/include
)
set
(
LIBEXEC_STAGE_PATH
${
STAGE_DIR
}
/libexec/openstructure
)
set
(
SHARED_DATA_PATH
${
STAGE_DIR
}
/share/openstructure
)
if
(
UNIX AND NOT APPLE
)
check_architecture
()
endif
()
if
(
OST_REV
)
message
(
"Revision:
${
OST_REV
}
"
)
set
(
ARCH
${
CMAKE_NATIVE_ARCH
}
)
if
(
"
${
ARCH
}
"
MATCHES
"64"
)
set
(
LIB_DIR lib64
)
set
(
LIB_STAGE_PATH
"
${
STAGE_DIR
}
/lib64"
)
else
()
set
(
LIB_DIR lib
)
set
(
LIB_STAGE_PATH
"
${
STAGE_DIR
}
/lib"
)
endif
()
include_directories
(
"
${
HEADER_STAGE_PATH
}
"
)
link_directories
(
${
LIB_STAGE_PATH
}
)
endmacro
()
#-------------------------------------------------------------------------------
# get compiler version
#-------------------------------------------------------------------------------
function
(
get_compiler_version _OUTPUT_VERSION
)
exec_program
(
${
CMAKE_CXX_COMPILER
}
ARGS
${
CMAKE_CXX_COMPILER_ARG1
}
-dumpversion
OUTPUT_VARIABLE _COMPILER_VERSION
)
string
(
REGEX REPLACE
"([0-9])
\\
.([0-9])(
\\
.[0-9])?"
"
\\
1
\\
2"
_COMPILER_VERSION
${
_COMPILER_VERSION
}
)
set
(
${
_OUTPUT_VERSION
}
${
_COMPILER_VERSION
}
PARENT_SCOPE
)
endfunction
()
macro
(
setup_compiler_flags
)
if
(
WIN32
)
# add_definitions(-DBOOST_TEST_INCLUDED)
add_definitions
(
-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE -DNOMINMAX
)
add_definitions
(
-Zc:wchar_t-
)
#
# add_definitions(-MDd -vmg -EHsc -GR)
#GR:Uses the __fastcall calling convention (x86 only).
#-EHsc to specify the synchronous exception handling mode/
#-vmg Uses full generality for pointers to members.
add_definitions
(
-DBOOST_ZLIB_BINARY=zdll
)
#add_definitions(-NODEFAULTLIB:LIBCMTD.lib)
endif
()
if
(
CMAKE_COMPILER_IS_GNUCXX
)
get_compiler_version
(
_GCC_VERSION
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall"
)
if
(
_GCC_VERSION MATCHES
"44"
)
# gcc 4.4. is very strict about aliasing rules. the shared_count
# implementation that is used boost's shared_ptr violates these rules. To
# silence the warnings and prevent miscompiles, enable
# -fno-strict-aliasing
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fno-strict-aliasing"
)
endif
()
endif
()
endmacro
()
This diff is collapsed.
Click to expand it.
deployment/CMakeLists.txt
+
2
−
1
View file @
f5d2ad65
get_ost_rev
()
# todo implement get_ost_rev for git
#get_ost_rev()
include
(
Deployment
)
set
(
SUBST_DIC OST_VERSION=
"
${
OST_VERSION
}
"
)
add_custom_target
(
deploymnt ALL
)
...
...
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