Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
JPSvis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
JuPedSim
JPSvis
Commits
1c9bf7f0
Commit
1c9bf7f0
authored
10 years ago
by
Mohcine Chraibi
Browse files
Options
Downloads
Patches
Plain Diff
Bundle for Mac OS.
parent
94df29e0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+105
-6
105 additions, 6 deletions
CMakeLists.txt
with
105 additions
and
6 deletions
CMakeLists.txt
+
105
−
6
View file @
1c9bf7f0
# Documentation: Some useful options:
# -DCMAKE_CXX_COMPILER:STRING=clang++ -DCMAKE_C_COMPILER:STRING=clang .
# -DCMAKE_BUILD_TYPE:STRING=Debug (default Release)
# -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON (default OFF)
# -DBUILD_TESTING=ON (default OFF)
#--------------------------------------------------------------------------
# ------------------------- Begin Generic CMake Variable Logging ------------------
# ------------------------- Begin Generic CMake Variable Logging ------------------
# the short system name, e.g. "Linux", "FreeBSD" or "Windows"
# the short system name, e.g. "Linux", "FreeBSD" or "Windows"
...
@@ -49,8 +57,19 @@ message( STATUS "JPSVIS_VERSION: " ${JPSVIS_VERSION} )
...
@@ -49,8 +57,19 @@ message( STATUS "JPSVIS_VERSION: " ${JPSVIS_VERSION} )
# (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)
# (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)
INCLUDE_DIRECTORIES
(
${
CMAKE_BINARY_DIR
}
)
INCLUDE_DIRECTORIES
(
${
CMAKE_BINARY_DIR
}
)
INCLUDE_DIRECTORIES
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
INCLUDE_DIRECTORIES
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
# For Apple set the icns file containing icons
IF
(
APPLE
)
# set how it shows up in the Info.plist file
SET
(
MACOSX_BUNDLE_ICON_FILE JPSvis.icns
)
# set where in the bundle to put the icns file
SET_SOURCE_FILES_PROPERTIES
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/forms/icons/JPSvis.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources
)
# include the icns file in the target
SET
(
SAMPLE_SRCS
${
SAMPLE_SRCS
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/forms/icons/JPSvis.icns
)
ENDIF
(
APPLE
)
set
(
SAMPLE_SRCS
set
(
SAMPLE_SRCS
src/fix/osx_thread_fix.mm
src/geometry/Building.cpp
src/geometry/Building.cpp
src/geometry/Crossing.cpp
src/geometry/Crossing.cpp
src/geometry/Goal.cpp
src/geometry/Goal.cpp
...
@@ -96,6 +115,7 @@ set( SAMPLE_SRCS
...
@@ -96,6 +115,7 @@ set( SAMPLE_SRCS
)
)
# all header files that should be treated with moc
# all header files that should be treated with moc
set
(
SAMPLE_HDR
set
(
SAMPLE_HDR
src/fix/osx_thread_fix.h
src/geometry/Building.h
src/geometry/Building.h
src/geometry/Crossing.h
src/geometry/Crossing.h
src/geometry/Goal.h
src/geometry/Goal.h
...
@@ -169,8 +189,17 @@ include(${VTK_USE_FILE})
...
@@ -169,8 +189,17 @@ include(${VTK_USE_FILE})
# Instruct CMake to run moc automatically when needed.
# Instruct CMake to run moc automatically when needed.
set
(
CMAKE_AUTOMOC ON
)
set
(
CMAKE_AUTOMOC ON
)
#--------------- here comes QT. Version problem (4 or 5?)
# This sets the windows build that will need the special winmain@16 call. Qt provides
# this for us in the qtmain.lib file. Using this cmake code will ensure we have it
# linked into our build. Not needed on Unix/OS X/Linux which is why we have the
# IF(WIN32) conditional.
IF
(
WIN32
)
SET
(
QT_USE_QTMAIN TRUE
)
ENDIF
(
WIN32
)
#--------------- here comes QT. Version problem (4 or 5?)
#FIND_PACKAGE( Qt4 REQUIRED )
#FIND_PACKAGE( Qt4 REQUIRED )
#FIND_PACKAGE(QT REQUIRED)
#FIND_PACKAGE(QT REQUIRED)
...
@@ -215,7 +244,8 @@ elseif( ${QT5_INSTALLED} )
...
@@ -215,7 +244,8 @@ elseif( ${QT5_INSTALLED} )
endif
()
endif
()
# here we instruct CMake to build JPSvis executable from all of the source files
# here we instruct CMake to build JPSvis executable from all of the source files
ADD_EXECUTABLE
(
JPSvis
${
SAMPLE_SRCS
}
ADD_EXECUTABLE
(
JPSvis MACOSX_BUNDLE WIN32
${
SAMPLE_SRCS
}
${
SAMPLE_MOC_HDRS
}
${
SAMPLE_MOC_HDRS
}
${
SAMPLE_UI_HDRS
}
${
SAMPLE_UI_HDRS
}
${
SAMPLE_RESOURCES_RCS
}
${
SAMPLE_RESOURCES_RCS
}
...
@@ -284,3 +314,72 @@ endif(CMAKE_BUILD_TYPE MATCHES Debug)
...
@@ -284,3 +314,72 @@ endif(CMAKE_BUILD_TYPE MATCHES Debug)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"PGI"
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"PGI"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
--c++11 -Minform=inform"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
--c++11 -Minform=inform"
)
endif
()
endif
()
#--------------------------------------------------------------------------------
# Now the installation stuff below
#--------------------------------------------------------------------------------
SET
(
plugin_dest_dir bin
)
SET
(
qtconf_dest_dir bin
)
SET
(
APPS
"
\$
{CMAKE_INSTALL_PREFIX}/bin/JPSvis"
)
IF
(
APPLE
)
SET
(
plugin_dest_dir JPSvis.app/Contents/MacOS
)
SET
(
qtconf_dest_dir JPSvis.app/Contents/Resources
)
SET
(
APPS
"
\$
{CMAKE_INSTALL_PREFIX}/JPSvis.app"
)
ENDIF
(
APPLE
)
IF
(
WIN32
)
SET
(
APPS
"
\$
{CMAKE_INSTALL_PREFIX}/bin/JPSvis.exe"
)
ENDIF
(
WIN32
)
#--------------------------------------------------------------------------------
# Install the QtTest application, on Apple, the bundle is at the root of the
# install tree, and on other platforms it'll go into the bin directory.
INSTALL
(
TARGETS JPSvis
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime
)
#--------------------------------------------------------------------------------
# Install needed Qt plugins by copying directories from the qt installation
# One can cull what gets copied by using 'REGEX "..." EXCLUDE'
INSTALL
(
DIRECTORY
"
${
QT_PLUGINS_DIR
}
/imageformats"
DESTINATION
${
plugin_dest_dir
}
/plugins COMPONENT Runtime
)
#--------------------------------------------------------------------------------
# install a qt.conf file
# this inserts some cmake code into the install script to write the file
INSTALL
(
CODE
"
file(WRITE
\"\$
{CMAKE_INSTALL_PREFIX}/
${
qtconf_dest_dir
}
/qt.conf
\"
\"\"
)
"
COMPONENT Runtime
)
#--------------------------------------------------------------------------------
# Use BundleUtilities to get all other dependencies for the application to work.
# It takes a bundle or executable along with possible plugins and inspects it
# for dependencies. If they are not system dependencies, they are copied.
# directories to look for dependencies
SET
(
DIRS
${
QT_LIBRARY_DIRS
}
)
# Now the work of copying dependencies into the bundle/package
# The quotes are escaped and variables to use at install time have their $ escaped
# An alternative is the do a configure_file() on a script and use install(SCRIPT ...).
# Note that the image plugins depend on QtSvg and QtXml, and it got those copied
# over.
INSTALL
(
CODE
"
file(GLOB_RECURSE QTPLUGINS
\"\$
{CMAKE_INSTALL_PREFIX}/
${
plugin_dest_dir
}
/plugins/*
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
\"
)
include(BundleUtilities)
fixup_bundle(
\"
${
APPS
}
\"
\"\$
{QTPLUGINS}
\"
\"
${
DIRS
}
\"
)
"
COMPONENT Runtime
)
# To Create a package, one can run "cpack -G DragNDrop CPackConfig.cmake" on Mac OS X
# where CPackConfig.cmake is created by including CPack
# And then there's ways to customize this as well
set
(
CPACK_BINARY_DRAGNDROP ON
)
include
(
CPack
)
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