Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #38: use CMAKE_INSTALL_PREFIX #40

Merged
merged 2 commits into from Oct 3, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 14 additions & 15 deletions CMakeLists.txt
Expand Up @@ -173,7 +173,7 @@ SET(BUILD_PLATFORM "${PLATFORM_NAME}:${PLATFORM_ABI}" CACHE STRING
# Make sure "sandbox" input & output directories are set. During
# SimTK Core build, the build system will set them. Otherwise, we'll
# set them to sensible local values.
# If SimTK_INSTALL_PREFIX is set then
# If CMAKE_INSTALL_PREFIX is set then
# it is a sandbox installation area, otherwise we want to install
# in /usr/local/simbody or %ProgramFiles%\Simbody.
#
Expand All @@ -183,14 +183,21 @@ SET(BUILD_PLATFORM "${PLATFORM_NAME}:${PLATFORM_ABI}" CACHE STRING
# older system you might have to set it manually.
SET(LIB64)

# For backward compatibility, use SimTK_INSTALL_PREFIX if
# CMAKE_INSTALL_PREFIX hasn't been set.
IF(SimTK_INSTALL_PREFIX AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX ${SimTK_INSTALL_PREFIX} CACHE PATH
"Install path prefix." FORCE)
ENDIF()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that this section is actually working. The intent was to allow cmake .. -DSimTK_INSTALL_PREFIX=${PREFIX}, but I think it's not working.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that is because CMAKE_INSTALL_PREFIX is always set. It might work if you erased it with something like cmake -DCMAKE_INSTALL_PREFIX= -DSimTK_INSTALL_PREFIX=${PREFIX}

Still, I'm having trouble thinking of any reason why we need to continue supporting SimTK_INSTALL_PREFIX.


# C compiler is gcc on Linux, gcc or cc on Mac where command line tools
# are installed from XCode. May be clang in Mac 10.8 or later.

IF(${CMAKE_C_COMPILER} MATCHES "cc" OR ${CMAKE_C_COMPILER} MATCHES "clang")
IF(NOT SimTK_INSTALL_PREFIX)
SET(SimTK_INSTALL_PREFIX "/usr/local/simbody"
IF(NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr/local/simbody"
CACHE PATH "Install directory")
ENDIF(NOT SimTK_INSTALL_PREFIX)
ENDIF(NOT CMAKE_INSTALL_PREFIX)

# As of Ubuntu 12, 64 bit libraries are in lib, not lib64
#IF(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
Expand All @@ -214,21 +221,13 @@ ELSE() # Windows
endif()
ENDIF()

IF(NOT SimTK_INSTALL_PREFIX)
SET(SimTK_INSTALL_PREFIX "${PROGFILEDIR}/Simbody"
IF(NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "${PROGFILEDIR}/Simbody"
CACHE PATH "Install directory")
ENDIF(NOT SimTK_INSTALL_PREFIX)
ENDIF(NOT CMAKE_INSTALL_PREFIX)

ENDIF()

# CMake installs go into CMAKE_INSTALL_PREFIX, which is always
# set to something incorrect by CMake. We'll use SimTK_INSTALL_PREFIX
# instead which is passed in by the build system or set above.
SET(CMAKE_INSTALL_PREFIX ${SimTK_INSTALL_PREFIX} CACHE STRING
"Install path prefix." FORCE)
# User should set SimTK_INSTALL_PREFIX, so suppress cmake's
mark_as_advanced(CMAKE_INSTALL_PREFIX)

# On Mac, we'll use the defaults for the architecture and deployment target.
# This works OK on OSX 10.8. For older systems, or if you want to build for
# an older deployment target, or 32 bit or univeral binaries, you may have
Expand Down
6 changes: 3 additions & 3 deletions Platform/CMakeLists.txt
Expand Up @@ -64,13 +64,13 @@ FOREACH(LIBF ${LIB_FILES})
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
ELSE()
INSTALL(FILES ${LIBF}
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64})
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64})
ENDIF()
ENDFOREACH()

Expand All @@ -93,6 +93,6 @@ FOREACH(INCLF ${INCL_FILES})
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
DESTINATION ${SimTK_INSTALL_PREFIX}/include )
DESTINATION ${CMAKE_INSTALL_PREFIX}/include )
ENDFOREACH()

12 changes: 6 additions & 6 deletions SimTKcommon/sharedTarget/CMakeLists.txt
Expand Up @@ -22,9 +22,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin )
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
ENDIF(BUILD_UNVERSIONED_LIBRARIES)

IF(BUILD_VERSIONED_LIBRARIES)
Expand All @@ -46,9 +46,9 @@ IF(BUILD_VERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin )
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
ENDIF(BUILD_VERSIONED_LIBRARIES)


12 changes: 6 additions & 6 deletions SimTKcommon/staticTarget/CMakeLists.txt
Expand Up @@ -18,9 +18,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES)

INSTALL(TARGETS ${STATIC_TARGET}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin )
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
ENDIF(BUILD_UNVERSIONED_LIBRARIES)

IF(BUILD_VERSIONED_LIBRARIES)
Expand All @@ -37,7 +37,7 @@ IF(BUILD_VERSIONED_LIBRARIES)

INSTALL(TARGETS ${STATIC_TARGET_VN}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin )
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
ENDIF(BUILD_VERSIONED_LIBRARIES)
12 changes: 6 additions & 6 deletions SimTKmath/sharedTarget/CMakeLists.txt
Expand Up @@ -44,9 +44,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

ENDIF(BUILD_UNVERSIONED_LIBRARIES)

Expand All @@ -71,8 +71,8 @@ IF(BUILD_VERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

ENDIF(BUILD_VERSIONED_LIBRARIES)
12 changes: 6 additions & 6 deletions SimTKmath/staticTarget/CMakeLists.txt
Expand Up @@ -45,9 +45,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

ENDIF(BUILD_UNVERSIONED_LIBRARIES)

Expand All @@ -71,8 +71,8 @@ IF(BUILD_VERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

ENDIF(BUILD_VERSIONED_LIBRARIES)
4 changes: 2 additions & 2 deletions Simbody/Visualizer/VisualizerGUI/CMakeLists.txt
Expand Up @@ -36,7 +36,7 @@ INSTALL(TARGETS ${GUI_NAME}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

# on Windows we also have to copy and later install the glut32.dll
IF(WIN32)
Expand All @@ -47,5 +47,5 @@ IF(WIN32)
COMMENT "Copying glut32.dll" VERBATIM)

INSTALL(FILES ${glut32libdir}/glut32.dll
DESTINATION ${SimTK_INSTALL_PREFIX}/bin) #same as GUI
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) #same as GUI
ENDIF()
12 changes: 6 additions & 6 deletions Simbody/sharedTarget/CMakeLists.txt
Expand Up @@ -26,9 +26,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)


ENDIF(BUILD_UNVERSIONED_LIBRARIES)
Expand Down Expand Up @@ -57,8 +57,8 @@ IF(BUILD_VERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

ENDIF(BUILD_VERSIONED_LIBRARIES)
12 changes: 6 additions & 6 deletions Simbody/staticTarget/CMakeLists.txt
Expand Up @@ -26,9 +26,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

ENDIF(BUILD_UNVERSIONED_LIBRARIES)

Expand Down Expand Up @@ -56,8 +56,8 @@ IF(BUILD_VERSIONED_LIBRARIES)
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin)
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

ENDIF(BUILD_VERSIONED_LIBRARIES)
2 changes: 1 addition & 1 deletion debian/rules
Expand Up @@ -8,7 +8,7 @@

override_dh_auto_configure:
dh_auto_configure -- \
-DSimTK_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DBUILD_EXAMPLES:BOOL=False

override_dh_auto_install:
Expand Down