Last active
September 2, 2015 17:50
-
-
Save jcfr/11233992 to your computer and use it in GitHub Desktop.
Illustrate issue with file(INSTALL ....) function on MacOSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8.6) | |
file(WRITE "${CMAKE_SOURCE_DIR}/foo.cpp" | |
" | |
class foo | |
{ | |
public: | |
foo(){} | |
~foo(){} | |
}; | |
") | |
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE PATH "" FORCE) | |
project(foo) | |
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) | |
add_library(foo SHARED foo.cpp) | |
install(TARGETS foo EXPORT PythonTargets | |
ARCHIVE DESTINATION archive | |
LIBRARY DESTINATION lib | |
RUNTIME DESTINATION bin | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To reproduce:
On linux, using CMake 2.8.11.2 or CMake 3.0.0-rc4 the output is:
OK: Running
make install
multiple times in a row always outputUp-to-date: /path/to/libfoo.so
On MacOSX 10.8, using CMake 2.8.11.2 or CMake 3.0.0-rc4 the output is:
NOT OK: Running
make install
multiple times in a row outputsInstalling: /path/to/libfoo.dylib
In the context of _superbuild_ project this is an issue because it cause dependent project to recompile and/or relink if not needed.