summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-11-09 12:06:39 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-11-09 12:06:39 +0000
commite94114d92fc9198dd63da53d693685709e987db1 (patch)
tree7b56f170bd046a91fcdb81a3b85bce545c2b29f7
parent00ea15803c02dcdafa1b93b125bd5a5cfcd0f5a0 (diff)
cmake: Make logical target names globally unique.
Cmake requires logical target names must be globally unique, but several progs have the same name. Although we got away overriding this policy on unices, it must be ovserved for MSVC project generation. For more information see cmake --help-policy CMP0002
-rw-r--r--CMakeLists.txt3
-rw-r--r--src/demos/CMakeLists.txt8
-rw-r--r--src/fp/CMakeLists.txt10
-rw-r--r--src/fpglsl/CMakeLists.txt10
-rw-r--r--src/gs/CMakeLists.txt10
-rw-r--r--src/perf/CMakeLists.txt8
-rw-r--r--src/redbook/CMakeLists.txt8
-rw-r--r--src/samples/CMakeLists.txt10
-rw-r--r--src/tests/CMakeLists.txt11
-rw-r--r--src/trivial/CMakeLists.txt8
-rw-r--r--src/vp/CMakeLists.txt10
-rw-r--r--src/vpglsl/CMakeLists.txt10
-rw-r--r--src/wgl/CMakeLists.txt6
-rw-r--r--src/xdemos/CMakeLists.txt18
14 files changed, 78 insertions, 52 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53ad2623..852a8870 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,5 @@
cmake_minimum_required (VERSION 2.6)
-# Allow targets with duplicate names
-cmake_policy(SET CMP0002 OLD)
-
project (mesademos)
find_package (OpenGL REQUIRED)
diff --git a/src/demos/CMakeLists.txt b/src/demos/CMakeLists.txt
index f1614fda..55e7bb3b 100644
--- a/src/demos/CMakeLists.txt
+++ b/src/demos/CMakeLists.txt
@@ -17,6 +17,8 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir demos)
+
set (targets
arbfplight
arbfslight
@@ -74,12 +76,14 @@ set (targets
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
add_executable (rain rain.cxx particles.cxx)
-install (TARGETS ${targets} rain DESTINATION demos)
+install (TARGETS rain DESTINATION demos)
file (GLOB data *.dat)
diff --git a/src/fp/CMakeLists.txt b/src/fp/CMakeLists.txt
index 658ab1c3..44cf5e2a 100644
--- a/src/fp/CMakeLists.txt
+++ b/src/fp/CMakeLists.txt
@@ -17,6 +17,8 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir fp)
+
set (targets
fp-tri
tri-depth
@@ -29,11 +31,11 @@ set (targets
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-install (TARGETS ${targets} DESTINATION fp)
-
file (GLOB data *.txt)
-install (FILES ${data} DESTINATION fp)
+install (FILES ${data} DESTINATION ${subdir})
diff --git a/src/fpglsl/CMakeLists.txt b/src/fpglsl/CMakeLists.txt
index 3dd9a479..c7efb2cf 100644
--- a/src/fpglsl/CMakeLists.txt
+++ b/src/fpglsl/CMakeLists.txt
@@ -17,16 +17,18 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir fpglsl)
+
set (targets
fp-tri
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-install (TARGETS ${targets} DESTINATION fpglsl)
-
file (GLOB data *.glsl)
-install (FILES ${data} DESTINATION fpglsl)
+install (FILES ${data} DESTINATION ${subdir})
diff --git a/src/gs/CMakeLists.txt b/src/gs/CMakeLists.txt
index 3ecd4aab..2de72cb4 100644
--- a/src/gs/CMakeLists.txt
+++ b/src/gs/CMakeLists.txt
@@ -17,16 +17,18 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir gs)
+
set (targets
gs-tri
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-install (TARGETS ${targets} DESTINATION gs)
-
file (GLOB data *.glsl)
-install (FILES ${data} DESTINATION gs)
+install (FILES ${data} DESTINATION ${subdir})
diff --git a/src/perf/CMakeLists.txt b/src/perf/CMakeLists.txt
index a3754ed6..ecd4216f 100644
--- a/src/perf/CMakeLists.txt
+++ b/src/perf/CMakeLists.txt
@@ -17,6 +17,8 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir perf)
+
set (targets
copytex
drawoverhead
@@ -31,7 +33,7 @@ set (targets
)
foreach (target ${targets})
- add_executable (${target} ${target}.c common.c glmain.c)
+ add_executable (${subdir}_${target} ${target}.c common.c glmain.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-
-install (TARGETS ${targets} DESTINATION perf)
diff --git a/src/redbook/CMakeLists.txt b/src/redbook/CMakeLists.txt
index 8b84913b..3311d993 100644
--- a/src/redbook/CMakeLists.txt
+++ b/src/redbook/CMakeLists.txt
@@ -17,6 +17,8 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir redbook)
+
set (targets
aaindex
aapoly
@@ -97,7 +99,7 @@ set (targets
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-
-install (TARGETS ${targets} DESTINATION redbook)
diff --git a/src/samples/CMakeLists.txt b/src/samples/CMakeLists.txt
index b0dcb955..3d5d9fc3 100644
--- a/src/samples/CMakeLists.txt
+++ b/src/samples/CMakeLists.txt
@@ -17,6 +17,8 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir samples)
+
set (targets
accum
bitmap1
@@ -50,11 +52,11 @@ set (targets
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-install (TARGETS ${targets} DESTINATION samples)
-
if (X11_FOUND)
include_directories (
${X11_INCLUDE_DIR}
@@ -72,5 +74,5 @@ if (X11_FOUND)
add_executable (${xtarget} ${xtarget}.c)
endforeach (xtarget)
- install (TARGETS ${xtargets} DESTINATION tests)
+ install (TARGETS ${xtargets} DESTINATION ${subdir})
endif (X11_FOUND)
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 72105ab2..c246dad6 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -17,6 +17,8 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir tests)
+
set (targets
afsmultiarb
antialias
@@ -131,11 +133,11 @@ set (targets
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-install (TARGETS ${targets} DESTINATION tests)
-
if (X11_FOUND)
include_directories (
${X11_INCLUDE_DIR}
@@ -156,6 +158,5 @@ if (X11_FOUND)
add_executable (${xtarget} ${xtarget}.c)
endforeach (xtarget)
- install (TARGETS ${xtargets} DESTINATION tests)
+ install (TARGETS ${xtargets} DESTINATION ${subdir})
endif (X11_FOUND)
-
diff --git a/src/trivial/CMakeLists.txt b/src/trivial/CMakeLists.txt
index 8af7b307..7aea9e99 100644
--- a/src/trivial/CMakeLists.txt
+++ b/src/trivial/CMakeLists.txt
@@ -17,6 +17,8 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir trivial)
+
set (targets
clear-color
clear-fbo
@@ -190,7 +192,7 @@ set (targets
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-
-install (TARGETS ${targets} DESTINATION trivial)
diff --git a/src/vp/CMakeLists.txt b/src/vp/CMakeLists.txt
index e83c7044..34cf2494 100644
--- a/src/vp/CMakeLists.txt
+++ b/src/vp/CMakeLists.txt
@@ -17,16 +17,18 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir vp)
+
set (targets
vp-tris
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-install (TARGETS ${targets} DESTINATION vp)
-
file (GLOB data *.txt)
-install (FILES ${data} DESTINATION vp)
+install (FILES ${data} DESTINATION ${subdir})
diff --git a/src/vpglsl/CMakeLists.txt b/src/vpglsl/CMakeLists.txt
index 72b9fd1d..0aa9709b 100644
--- a/src/vpglsl/CMakeLists.txt
+++ b/src/vpglsl/CMakeLists.txt
@@ -17,16 +17,18 @@ link_libraries (
${GLEW_glew_LIBRARY}
)
+set (subdir vpglsl)
+
set (targets
vp-tris
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-install (TARGETS ${targets} DESTINATION vpglsl)
-
file (GLOB data *.glsl)
-install (FILES ${data} DESTINATION vpglsl)
+install (FILES ${data} DESTINATION ${subdir})
diff --git a/src/wgl/CMakeLists.txt b/src/wgl/CMakeLists.txt
index 35835609..2a859549 100644
--- a/src/wgl/CMakeLists.txt
+++ b/src/wgl/CMakeLists.txt
@@ -9,7 +9,9 @@ link_libraries (
)
add_executable (wglthreads wglthreads/wglthreads.c)
-add_executable (sharedtex_mt sharedtex_mt/sharedtex_mt.c)
+add_executable (wgl_sharedtex_mt sharedtex_mt/sharedtex_mt.c)
+set_target_properties (wgl_sharedtex_mt PROPERTIES OUTPUT_NAME sharedtex_mt)
+
add_executable (wglinfo wglinfo.c)
-install (TARGETS wglthreads sharedtex_mt wglthreads DESTINATION wgl)
+install (TARGETS wglthreads wgl_sharedtex_mt wglthreads DESTINATION wgl)
diff --git a/src/xdemos/CMakeLists.txt b/src/xdemos/CMakeLists.txt
index 73e6406f..b335fcf6 100644
--- a/src/xdemos/CMakeLists.txt
+++ b/src/xdemos/CMakeLists.txt
@@ -19,6 +19,8 @@ link_libraries (
add_library (pbutil pbutil.c)
+set (subdir xdemos)
+
set (targets
glsync
glthreads
@@ -54,16 +56,18 @@ set (targets
)
foreach (target ${targets})
- add_executable (${target} ${target}.c)
+ add_executable (${subdir}_${target} ${target}.c)
+ set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
+ install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
-target_link_libraries (glthreads pthread)
-target_link_libraries (glxgears_fbconfig pbutil)
-target_link_libraries (pbdemo pbutil)
-target_link_libraries (pbinfo pbutil)
-target_link_libraries (sharedtex_mt pthread)
+target_link_libraries (${subdir}_glthreads pthread)
+target_link_libraries (${subdir}_glxgears_fbconfig pbutil)
+target_link_libraries (${subdir}_pbdemo pbutil)
+target_link_libraries (${subdir}_pbinfo pbutil)
+target_link_libraries (${subdir}_sharedtex_mt pthread)
add_executable (corender corender.c ipc.c)
add_executable (xrotfontdemo xrotfontdemo.c xuserotfont.c)
-install (TARGETS ${targets} corender xrotfontdemo DESTINATION xdemos)
+install (TARGETS corender xrotfontdemo DESTINATION demos)