summaryrefslogtreecommitdiff
path: root/DevIL/src-ILU/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'DevIL/src-ILU/CMakeLists.txt')
-rw-r--r--DevIL/src-ILU/CMakeLists.txt42
1 files changed, 33 insertions, 9 deletions
diff --git a/DevIL/src-ILU/CMakeLists.txt b/DevIL/src-ILU/CMakeLists.txt
index 65c0f09c..bb7479c4 100644
--- a/DevIL/src-ILU/CMakeLists.txt
+++ b/DevIL/src-ILU/CMakeLists.txt
@@ -6,6 +6,18 @@ file(GLOB ILU_SRCS src/*.cpp)
file(GLOB ILU_INC include/*.h ../include/IL/devil_internal_exports.h ../include/IL/ilu.h)
file(GLOB ILU_RSRC)
+# From http://stackoverflow.com/questions/17317350/compiling-32-and-64-bit
+MESSAGE(" ")
+if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+ MESSAGE( "64 bit compiler detected" )
+ SET( EX_PLATFORM 64 )
+ SET( EX_PLATFORM_NAME "x64" )
+else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+ MESSAGE( "32 bit compiler detected" )
+ SET( EX_PLATFORM 32 )
+ SET( EX_PLATFORM_NAME "x86" )
+endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+
include_directories( include ../include )
# for windows add the .def and .rc files to the source list
@@ -45,15 +57,27 @@ target_link_libraries(ILU
configure_file( pkgconfig/ILU.pc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ILU.pc @ONLY)
-if(UNICODE)
- set_target_properties(ILU PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../lib/unicode")
- set_target_properties(ILU PROPERTIES LIBRARY_OUTPUT_DIRECTORY "../lib/unicode")
- set_target_properties(ILU PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "../lib/unicode")
-else(UNICODE)
- set_target_properties(ILU PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../lib")
- set_target_properties(ILU PROPERTIES LIBRARY_OUTPUT_DIRECTORY "../lib")
- set_target_properties(ILU PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "../lib")
-endif(UNICODE)
+if(EX_PLATFORM EQUAL 64)
+ if(UNICODE)
+ set_target_properties(ILU PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../lib/x64/unicode")
+ set_target_properties(ILU PROPERTIES LIBRARY_OUTPUT_DIRECTORY "../lib/x64/unicode")
+ set_target_properties(ILU PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "../lib/x64/unicode")
+ else(UNICODE)
+ set_target_properties(ILU PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../lib/x64")
+ set_target_properties(ILU PROPERTIES LIBRARY_OUTPUT_DIRECTORY "../lib/x64")
+ set_target_properties(ILU PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "../lib/x64")
+ endif(UNICODE)
+else(EX_PLATFORM EQUAL 64)
+ if(UNICODE)
+ set_target_properties(ILU PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../lib/x86/unicode")
+ set_target_properties(ILU PROPERTIES LIBRARY_OUTPUT_DIRECTORY "../lib/x86/unicode")
+ set_target_properties(ILU PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "../lib/x86/unicode")
+ else(UNICODE)
+ set_target_properties(ILU PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../lib/x86")
+ set_target_properties(ILU PROPERTIES LIBRARY_OUTPUT_DIRECTORY "../lib/x86")
+ set_target_properties(ILU PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "../lib/x86")
+ endif(UNICODE)
+endif(EX_PLATFORM EQUAL 64)
if(UNICODE)
MESSAGE("Compiling ILU Unicode")