ENH: Testing new target properties RUNTIME_OUTPUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, and ARCHIVE_OUTPUT_DIRECTORY. This is an incremental fix for bug#2240 and bug#4210.
This commit is contained in:
parent
c03217d560
commit
cf7eeab37a
|
@ -137,13 +137,9 @@ SET(FORCE_TEST 0 CACHE STRING "a test" FORCE)
|
||||||
#
|
#
|
||||||
# Lib and exe path
|
# Lib and exe path
|
||||||
#
|
#
|
||||||
SET (LIBRARY_OUTPUT_PATH
|
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static")
|
||||||
${Complex_BINARY_DIR}/bin/ CACHE INTERNAL
|
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib")
|
||||||
"Single output directory for building all libraries.")
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin")
|
||||||
|
|
||||||
SET (EXECUTABLE_OUTPUT_PATH
|
|
||||||
${Complex_BINARY_DIR}/bin/ CACHE INTERNAL
|
|
||||||
"Single output directory for building all executables.")
|
|
||||||
|
|
||||||
MESSAGE (Test " " escape " " semi-colon " " \; \;)
|
MESSAGE (Test " " escape " " semi-colon " " \; \;)
|
||||||
#
|
#
|
||||||
|
|
|
@ -320,12 +320,17 @@ extern "C" int NameConflictTest2();
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::string lib = BINARY_DIR;
|
std::string lib = BINARY_DIR;
|
||||||
lib += "/bin/";
|
lib += "/lib/";
|
||||||
#ifdef CMAKE_INTDIR
|
#ifdef CMAKE_INTDIR
|
||||||
lib += CMAKE_INTDIR;
|
lib += CMAKE_INTDIR;
|
||||||
lib += "/";
|
lib += "/";
|
||||||
#endif
|
#endif
|
||||||
std::string exe = lib;
|
std::string exe = BINARY_DIR;
|
||||||
|
exe += "/bin/";
|
||||||
|
#ifdef CMAKE_INTDIR
|
||||||
|
exe += CMAKE_INTDIR;
|
||||||
|
exe += "/";
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef COMPLEX_TEST_CMAKELIB
|
#ifdef COMPLEX_TEST_CMAKELIB
|
||||||
// Test a single character executable to test a: in makefiles
|
// Test a single character executable to test a: in makefiles
|
||||||
|
|
|
@ -7,6 +7,7 @@ REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN)
|
||||||
#
|
#
|
||||||
UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
|
UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
|
||||||
ADD_EXECUTABLE(create_file create_file.cxx)
|
ADD_EXECUTABLE(create_file create_file.cxx)
|
||||||
|
SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create static library
|
# Create static library
|
||||||
|
|
|
@ -137,13 +137,9 @@ SET(FORCE_TEST 0 CACHE STRING "a test" FORCE)
|
||||||
#
|
#
|
||||||
# Lib and exe path
|
# Lib and exe path
|
||||||
#
|
#
|
||||||
SET (LIBRARY_OUTPUT_PATH
|
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static")
|
||||||
${Complex_BINARY_DIR}/bin/ CACHE INTERNAL
|
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib")
|
||||||
"Single output directory for building all libraries.")
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin")
|
||||||
|
|
||||||
SET (EXECUTABLE_OUTPUT_PATH
|
|
||||||
${Complex_BINARY_DIR}/bin/ CACHE INTERNAL
|
|
||||||
"Single output directory for building all executables.")
|
|
||||||
|
|
||||||
MESSAGE (Test " " escape " " semi-colon " " \; \;)
|
MESSAGE (Test " " escape " " semi-colon " " \; \;)
|
||||||
#
|
#
|
||||||
|
|
|
@ -320,12 +320,17 @@ extern "C" int NameConflictTest2();
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::string lib = BINARY_DIR;
|
std::string lib = BINARY_DIR;
|
||||||
lib += "/bin/";
|
lib += "/lib/";
|
||||||
#ifdef CMAKE_INTDIR
|
#ifdef CMAKE_INTDIR
|
||||||
lib += CMAKE_INTDIR;
|
lib += CMAKE_INTDIR;
|
||||||
lib += "/";
|
lib += "/";
|
||||||
#endif
|
#endif
|
||||||
std::string exe = lib;
|
std::string exe = BINARY_DIR;
|
||||||
|
exe += "/bin/";
|
||||||
|
#ifdef CMAKE_INTDIR
|
||||||
|
exe += CMAKE_INTDIR;
|
||||||
|
exe += "/";
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef COMPLEX_TEST_CMAKELIB
|
#ifdef COMPLEX_TEST_CMAKELIB
|
||||||
// Test a single character executable to test a: in makefiles
|
// Test a single character executable to test a: in makefiles
|
||||||
|
|
|
@ -7,6 +7,7 @@ REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN)
|
||||||
#
|
#
|
||||||
UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
|
UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
|
||||||
ADD_EXECUTABLE(create_file create_file.cxx)
|
ADD_EXECUTABLE(create_file create_file.cxx)
|
||||||
|
SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create static library
|
# Create static library
|
||||||
|
|
|
@ -137,13 +137,9 @@ SET(FORCE_TEST 0 CACHE STRING "a test" FORCE)
|
||||||
#
|
#
|
||||||
# Lib and exe path
|
# Lib and exe path
|
||||||
#
|
#
|
||||||
SET (LIBRARY_OUTPUT_PATH
|
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static")
|
||||||
${Complex_BINARY_DIR}/bin/ CACHE INTERNAL
|
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib")
|
||||||
"Single output directory for building all libraries.")
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin")
|
||||||
|
|
||||||
SET (EXECUTABLE_OUTPUT_PATH
|
|
||||||
${Complex_BINARY_DIR}/bin/ CACHE INTERNAL
|
|
||||||
"Single output directory for building all executables.")
|
|
||||||
|
|
||||||
MESSAGE (Test " " escape " " semi-colon " " \; \;)
|
MESSAGE (Test " " escape " " semi-colon " " \; \;)
|
||||||
#
|
#
|
||||||
|
|
|
@ -320,12 +320,17 @@ extern "C" int NameConflictTest2();
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::string lib = BINARY_DIR;
|
std::string lib = BINARY_DIR;
|
||||||
lib += "/bin/";
|
lib += "/lib/";
|
||||||
#ifdef CMAKE_INTDIR
|
#ifdef CMAKE_INTDIR
|
||||||
lib += CMAKE_INTDIR;
|
lib += CMAKE_INTDIR;
|
||||||
lib += "/";
|
lib += "/";
|
||||||
#endif
|
#endif
|
||||||
std::string exe = lib;
|
std::string exe = BINARY_DIR;
|
||||||
|
exe += "/bin/";
|
||||||
|
#ifdef CMAKE_INTDIR
|
||||||
|
exe += CMAKE_INTDIR;
|
||||||
|
exe += "/";
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef COMPLEX_TEST_CMAKELIB
|
#ifdef COMPLEX_TEST_CMAKELIB
|
||||||
// Test a single character executable to test a: in makefiles
|
// Test a single character executable to test a: in makefiles
|
||||||
|
|
|
@ -7,6 +7,7 @@ REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN)
|
||||||
#
|
#
|
||||||
UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
|
UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
|
||||||
ADD_EXECUTABLE(create_file create_file.cxx)
|
ADD_EXECUTABLE(create_file create_file.cxx)
|
||||||
|
SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create static library
|
# Create static library
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
PROJECT (TestSimpleInstall)
|
PROJECT (TestSimpleInstall)
|
||||||
SET(CMAKE_VERBOSE_MAKEFILE 1)
|
SET(CMAKE_VERBOSE_MAKEFILE 1)
|
||||||
#SET(EXECUTABLE_OUTPUT_PATH "${TestSimpleInstall_BINARY_DIR}/This is exec path")
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||||
SET(EXECUTABLE_OUTPUT_PATH "${TestSimpleInstall_BINARY_DIR}/ExecPath")
|
"${TestSimpleInstall_BINARY_DIR}/bin dir")
|
||||||
SET(LIBRARY_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}")
|
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
|
||||||
|
"${TestSimpleInstall_BINARY_DIR}/lib static")
|
||||||
|
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY
|
||||||
|
"${TestSimpleInstall_BINARY_DIR}/lib dir")
|
||||||
|
|
||||||
# Skip generating the rpath pointing at the build tree to make sure
|
# Skip generating the rpath pointing at the build tree to make sure
|
||||||
# the executable is installed with the proper rpath in the install
|
# the executable is installed with the proper rpath in the install
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
PROJECT (TestSimpleInstall)
|
PROJECT (TestSimpleInstall)
|
||||||
SET(CMAKE_VERBOSE_MAKEFILE 1)
|
SET(CMAKE_VERBOSE_MAKEFILE 1)
|
||||||
#SET(EXECUTABLE_OUTPUT_PATH "${TestSimpleInstall_BINARY_DIR}/This is exec path")
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||||
SET(EXECUTABLE_OUTPUT_PATH "${TestSimpleInstall_BINARY_DIR}/ExecPath")
|
"${TestSimpleInstall_BINARY_DIR}/bin dir")
|
||||||
SET(LIBRARY_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}")
|
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
|
||||||
|
"${TestSimpleInstall_BINARY_DIR}/lib static")
|
||||||
|
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY
|
||||||
|
"${TestSimpleInstall_BINARY_DIR}/lib dir")
|
||||||
|
|
||||||
# Skip generating the rpath pointing at the build tree to make sure
|
# Skip generating the rpath pointing at the build tree to make sure
|
||||||
# the executable is installed with the proper rpath in the install
|
# the executable is installed with the proper rpath in the install
|
||||||
|
|
Loading…
Reference in New Issue