diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-11-08 20:46:08 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-11-08 20:46:08 (GMT) |
commit | f5d95fb078ec48755762931fe2882ed1cbe1171e (patch) | |
tree | 945dca55d34b543db452c586aba0de863cf25cec /Modules/Platform | |
parent | c72462ffb1c75573e0d67a7101438a62bfc2fda1 (diff) | |
download | CMake-f5d95fb078ec48755762931fe2882ed1cbe1171e.zip CMake-f5d95fb078ec48755762931fe2882ed1cbe1171e.tar.gz CMake-f5d95fb078ec48755762931fe2882ed1cbe1171e.tar.bz2 |
Complete rework of makefile generators expect trouble
Diffstat (limited to 'Modules/Platform')
26 files changed, 427 insertions, 0 deletions
diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake new file mode 100644 index 0000000..38543f5 --- /dev/null +++ b/Modules/Platform/AIX.cmake @@ -0,0 +1,9 @@ +SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib +SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o") # .so +SET(CMAKE_DL_LIBS "-lld") + +IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared + SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-brtl") # +s, flag for exe link to use shared lib +ENDIF(CMAKE_COMPILER_IS_GNUCXX) diff --git a/Modules/Platform/BSDOS.cmake b/Modules/Platform/BSDOS.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Modules/Platform/BSDOS.cmake diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake new file mode 100644 index 0000000..6cb3e18 --- /dev/null +++ b/Modules/Platform/CYGWIN.cmake @@ -0,0 +1,11 @@ +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") +SET(CMAKE_DL_LIBS "-lgdi32" ) +SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") +SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") +# no pic for gcc on cygwin +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") +SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") +INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) +FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES gmake make ) +SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL + "What is the target build tool cmake is generating for.") diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake new file mode 100644 index 0000000..5a6068c --- /dev/null +++ b/Modules/Platform/Darwin.cmake @@ -0,0 +1,18 @@ +SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") +SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") +SET(CMAKE_SHARED_MODULE_SUFFIX ".so") +SET(CMAKE_DL_LIBS "") +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib") +SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -flat_namespace -undefined suppress") + +SET(CMAKE_CXX_CREATE_SHARED_LIBRARY + "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + +SET(CMAKE_C_CREATE_SHARED_LIBRARY + "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + +SET(CMAKE_CXX_CREATE_SHARED_MODULE + "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + +SET(CMAKE_C_CREATE_SHARED_MODULE + "<CMAKE_C_COMPILER> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake new file mode 100644 index 0000000..e9c9ab2 --- /dev/null +++ b/Modules/Platform/FreeBSD.cmake @@ -0,0 +1,8 @@ +IF(EXISTS /usr/include/dlfcn.h) + SET(CMAKE_DL_LIBS "") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared + SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, flag for exe link to use shared lib + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") # -rpath + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty +ENDIF(EXISTS /usr/include/dlfcn.h) diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake new file mode 100644 index 0000000..0f123b0 --- /dev/null +++ b/Modules/Platform/HP-UX.cmake @@ -0,0 +1,57 @@ +SET(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so +SET(CMAKE_DL_LIBS "-ldld") + +SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty + +# C compiler +IF(CMAKE_COMPILER_IS_GNUCC) + # gnu gcc + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-E -Wl,-b") # -shared + SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,+s") # +s, flag for exe link to use shared lib + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,+b") # -rpath + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic +ELSE(CMAKE_COMPILER_IS_GNUCC) + # hp cc + SET(CMAKE_ANSI_CFLAGS "-Ae -Aa") + # use ld directly to create shared libraries for hp cc + SET(CMAKE_C_CREATE_SHARED_LIBRARY + "ld <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "+Z") # -pic + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-E -b -L/usr/lib") # -shared + SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "+s") # +s, flag for exe link to use shared lib + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "+b") # -rpath +ENDIF(CMAKE_COMPILER_IS_GNUCC) + +# CXX compiler +IF(CMAKE_COMPILER_IS_GNUCXX) + INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) + # for gnu C++ + SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic + SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,-E -Wl,-b") # -shared + SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,+s") # +s, flag for exe link to use shared lib + SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,+b") # -rpath + SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic +ELSE(CMAKE_COMPILER_IS_GNUCXX) + # for hp aCC + SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "+Z") # -pic + SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "+Z -Wl,-E -b -L/usr/lib") # -shared + SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,+s") # +s, flag for exe link to use shared lib + SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,+b") # -rpath + SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic + + SET (CMAKE_CXX_FLAGS "" CACHE STRING + "Flags used by the compiler during all build types.") + SET (CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING + "Flags used by the compiler during debug builds.") + SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O3" CACHE STRING + "Flags used by the compiler during release minsize builds.") + SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING + "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") + SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g" CACHE STRING + "Flags used by the compiler during Release with Debug Info builds.") + SET (CMAKE_C_FLAGS "" CACHE STRING + "Flags for C compiler.") + +ENDIF(CMAKE_COMPILER_IS_GNUCXX) diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake new file mode 100644 index 0000000..62c374c --- /dev/null +++ b/Modules/Platform/IRIX.cmake @@ -0,0 +1,29 @@ +SET(CMAKE_DL_LIBS "") +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared") +SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -rdata_shared") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") # -rpath +SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty +IF(NOT CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_CREATE_STATIC_LIBRARY + "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>") + SET (CMAKE_CXX_FLAGS "" CACHE STRING + "Flags used by the compiler during all build types.") + + SET (CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING + "Flags used by the compiler during debug builds.") + + SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O3" CACHE STRING + "Flags used by the compiler during release minsize builds.") + + SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING + "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") + + SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING + "Flags used by the compiler during Release with Debug Info builds.") + + SET (CMAKE_C_FLAGS "" CACHE STRING + "Flags for C compiler.") +ELSE(NOT CMAKE_COMPILER_IS_GNUCXX) + INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) +ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) + diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake new file mode 100644 index 0000000..5ff1065 --- /dev/null +++ b/Modules/Platform/IRIX64.cmake @@ -0,0 +1,31 @@ +SET(CMAKE_DL_LIBS "") +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared") +SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -rdata_shared") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") # -rpath +SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty +IF(NOT CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_CREATE_STATIC_LIBRARY + "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>") + SET(CMAKE_ANSI_CXXFLAGS -LANG:std) + SET (CMAKE_CXX_FLAGS "" CACHE STRING + "Flags used by the compiler during all build types.") + + SET (CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING + "Flags used by the compiler during debug builds.") + + SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O3" CACHE STRING + "Flags used by the compiler during release minsize builds.") + + SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING + "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") + + SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING + "Flags used by the compiler during Release with Debug Info builds.") + + + SET (CMAKE_C_FLAGS "" CACHE STRING + "Flags for C compiler.") +ELSE(NOT CMAKE_COMPILER_IS_GNUCXX) + INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) +ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) + diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake new file mode 100644 index 0000000..b3091b7 --- /dev/null +++ b/Modules/Platform/Linux.cmake @@ -0,0 +1,7 @@ +SET(CMAKE_DL_LIBS "-ldl") +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") +SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-rdynamic") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") + diff --git a/Modules/Platform/MP-RAS.cmake b/Modules/Platform/MP-RAS.cmake new file mode 100644 index 0000000..5a644dc --- /dev/null +++ b/Modules/Platform/MP-RAS.cmake @@ -0,0 +1,9 @@ +IF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") +ELSE(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") + SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-Bexport") +ENDIF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") + + + diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake new file mode 100644 index 0000000..e9c9ab2 --- /dev/null +++ b/Modules/Platform/NetBSD.cmake @@ -0,0 +1,8 @@ +IF(EXISTS /usr/include/dlfcn.h) + SET(CMAKE_DL_LIBS "") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared + SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, flag for exe link to use shared lib + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") # -rpath + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty +ENDIF(EXISTS /usr/include/dlfcn.h) diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake new file mode 100644 index 0000000..0fb5348 --- /dev/null +++ b/Modules/Platform/OSF1.cmake @@ -0,0 +1,26 @@ +SET(CMAKE_DL_LIBS "") + +IF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]") +ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]") +IF(CMAKE_SYSTEM MATCHES "OSF1-1.*") + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic") # -pic + SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic") # -pic +ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.*") + + + +IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*") # -shared + SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,-expect_unresolved,\\*") # -shared + IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") + ELSE(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-rpath,") + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") +ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") + +IF(NOT CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_ANSI_CXXFLAGS "-std strict_ansi -nopure_cname") +ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) diff --git a/Modules/Platform/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Modules/Platform/OpenBSD.cmake diff --git a/Modules/Platform/RISCos.cmake b/Modules/Platform/RISCos.cmake new file mode 100644 index 0000000..1979d5e --- /dev/null +++ b/Modules/Platform/RISCos.cmake @@ -0,0 +1,4 @@ +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0") +SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o") +SET(CMAKE_DL_LIBS "") +SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000") diff --git a/Modules/Platform/SCO_SV.cmake b/Modules/Platform/SCO_SV.cmake new file mode 100644 index 0000000..89dcd56 --- /dev/null +++ b/Modules/Platform/SCO_SV.cmake @@ -0,0 +1,4 @@ +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-Kpic -belf") +SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Kpic -belf") +SET(CMAKE_DL_LIBS "") +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-belf -Wl,-Bexport") diff --git a/Modules/Platform/SINIX.cmake b/Modules/Platform/SINIX.cmake new file mode 100644 index 0000000..134d78b --- /dev/null +++ b/Modules/Platform/SINIX.cmake @@ -0,0 +1 @@ + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake new file mode 100644 index 0000000..94fe528 --- /dev/null +++ b/Modules/Platform/SunOS.cmake @@ -0,0 +1,25 @@ +IF(CMAKE_SYSTEM MATCHES "SunOS-4.*") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC") + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r -nostdlib") + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-R,") + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") +ENDIF(CMAKE_SYSTEM MATCHES "SunOS-4.*") + +IF(CMAKE_SYSTEM MATCHES "SunOS-5*.") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC") + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G") + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-R,") + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") + IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -nostdlib") + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-R,") + SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") + ENDIF(CMAKE_COMPILER_IS_GNUCXX) +ENDIF(CMAKE_SYSTEM MATCHES "SunOS-5*.") + +IF(NOT CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_CREATE_STATIC_LIBRARY + "<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> " + "<CMAKE_RANLIB> <TARGET> ") +ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) + diff --git a/Modules/Platform/True64.cmake b/Modules/Platform/True64.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Modules/Platform/True64.cmake diff --git a/Modules/Platform/ULTRIX.cmake b/Modules/Platform/ULTRIX.cmake new file mode 100644 index 0000000..4064721 --- /dev/null +++ b/Modules/Platform/ULTRIX.cmake @@ -0,0 +1,4 @@ +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0") +SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o") +SET(CMAKE_DL_LIBS "") +SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000") diff --git a/Modules/Platform/UNIX_SV.cmake b/Modules/Platform/UNIX_SV.cmake new file mode 100644 index 0000000..62b0e59 --- /dev/null +++ b/Modules/Platform/UNIX_SV.cmake @@ -0,0 +1,2 @@ +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") +SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-Bexport") diff --git a/Modules/Platform/UnixWare.cmake b/Modules/Platform/UnixWare.cmake new file mode 100644 index 0000000..80acb87 --- /dev/null +++ b/Modules/Platform/UnixWare.cmake @@ -0,0 +1,2 @@ +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport") diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake new file mode 100644 index 0000000..744e44c --- /dev/null +++ b/Modules/Platform/Windows-bcc32.cmake @@ -0,0 +1,78 @@ +SET(CMAKE_LIBRARY_PATH_FLAG "-L") +SET(CMAKE_LINK_LIBRARY_FLAG "") + +# create a shared C++ library +SET(CMAKE_CXX_CREATE_SHARED_LIBRARY + "<CMAKE_CXX_COMPILER> @&&|\n-e<TARGET> -tWD <OBJECTS> <LINK_LIBRARIES>\n|" + "implib @&&|\n-w <TARGET_BASE>.lib <TARGET_BASE>.dll\n|" +) + +SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) + +# create a C shared library +SET(CMAKE_C_CREATE_SHARED_LIBRARY + "<CMAKE_CXX_COMPILER> @&&|\n-e<TARGET> -tWD <OBJECTS> <LINK_LIBRARIES>\n|" + "implib @&&|\n-w <TARGET_BASE>.lib <TARGET_BASE>.dll\n|" +) + +# create a C shared module just copy the shared library rule +SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY}) + + +# create a C++ static library +SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "tlib @&&|\n/p512 /a <TARGET> <OBJECTS_QUOTED>\n|") + +# create a C static library +SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) + +# compile a C++ file into an object file +SET(CMAKE_CXX_COMPILE_OBJECT + "<CMAKE_CXX_COMPILER> @&&|\n-DWIN32 -o<OBJECT> <FLAGS> -c <SOURCE>\n|") + +# compile a C file into an object file +SET(CMAKE_C_COMPILE_OBJECT + "<CMAKE_C_COMPILER> @&&|\n-DWIN32 -o<OBJECT> <FLAGS> -c <SOURCE>\n|") + + +SET(CMAKE_C_LINK_EXECUTABLE + "<CMAKE_C_COMPILER> @&&|\n-e<TARGET> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> \n|") + + +SET(CMAKE_CXX_LINK_EXECUTABLE + "<CMAKE_CXX_COMPILER> @&&|\n -e<TARGET> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> \n|") + +SET (CMAKE_BUILD_TYPE Debug CACHE STRING + "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.") + +# extra flags for a win32 exe +SET(CMAKE_CREATE_WIN32_EXE -tW -tWM ) +# extra flags for a console app +SET(CMAKE_CREATE_CONSOLE_EXE -tWC ) + +SET (CMAKE_CXX_FLAGS "-w- -whid -waus -wpar -tWM -P" CACHE STRING + "Flags used to compile c++ files.") + +SET (CMAKE_CXX_FLAGS_DEBUG "-Od -v" CACHE STRING + "Flags used by the compiler during debug builds.") + +SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O1" CACHE STRING + "Flags used by the compiler during release minsize builds.") + +SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING + "Release flags.") + +SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Od" CACHE STRING + "Flags used by the compiler during Release with Debug Info builds.") + + +SET (CMAKE_C_FLAGS "-w- -whid -waus -tWM" CACHE STRING + "Flags for C compiler.") + +SET (CMAKE_STANDARD_LIBRARIES "import32.lib" CACHE STRING + "Libraries linked by defalut with all applications.") + +FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES make ) +SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL + "What is the target build tool cmake is generating for.") +MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES CMAKE_MAKE_PROGRAM) + diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake new file mode 100644 index 0000000..bf274fa --- /dev/null +++ b/Modules/Platform/Windows-cl.cmake @@ -0,0 +1,70 @@ +SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") +SET(CMAKE_LINK_LIBRARY_FLAG "") + +# create a shared C++ library +SET(CMAKE_CXX_CREATE_SHARED_LIBRARY + "link @<<\n /out:<TARGET> /dll <OBJECTS> <LINK_LIBRARIES> \n<<") + +SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) + +# create a C shared library +SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) + +# create a C shared module just copy the shared library rule +SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY}) + + +# create a C++ static library +SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib /nologo /out:<TARGET> <OBJECTS> ") + +# create a C static library +SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) + +# compile a C++ file into an object file +SET(CMAKE_CXX_COMPILE_OBJECT + "<CMAKE_CXX_COMPILER> @<<\n -DWIN32 /Fo<OBJECT> <FLAGS> -c <SOURCE>\n<<") + +# compile a C file into an object file +SET(CMAKE_C_COMPILE_OBJECT + "<CMAKE_C_COMPILER> @<<\n -DWIN32 /Fo<OBJECT> <FLAGS> -c <SOURCE>\n<<") + + +SET(CMAKE_C_LINK_EXECUTABLE + "<CMAKE_C_COMPILER> @<<\n <CMAKE_C_LINK_FLAGS> <FLAGS> <OBJECTS> /Fe<TARGET> -link <LINK_FLAGS> <LINK_LIBRARIES>\n<<") + +SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>") + +SET(CMAKE_CXX_LINK_EXECUTABLE + "<CMAKE_CXX_COMPILER> @<<\n <CMAKE_CXX_LINK_FLAGS> <FLAGS> <OBJECTS> /Fe<TARGET> -link <LINK_FLAGS> <LINK_LIBRARIES>\n<<") + +SET (CMAKE_BUILD_TYPE Debug CACHE STRING + "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.") + +SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) + +SET (CMAKE_CXX_FLAGS "/nologo /W3 /Zm1000 /GX /GR" CACHE STRING + "Flags used by the compiler during all build types, /GX /GR are for exceptions and rtti in VC++, /Zm1000 increases the compiler's memory allocation to support ANSI C++/stdlib.") + +SET (CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Od /GZ" CACHE STRING + "Flags used by the compiler during debug builds.") + +SET (CMAKE_CXX_FLAGS_MINSIZEREL "/MD /O1" CACHE STRING + "Flags used by the compiler during release minsize builds.") + +SET (CMAKE_CXX_FLAGS_RELEASE "/MD /O2" CACHE STRING + "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") + +SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /O2" CACHE STRING + "Flags used by the compiler during Release with Debug Info builds.") + + +SET (CMAKE_C_FLAGS "/nologo /W3 /Zm1000" CACHE STRING + "Flags for C compiler.") + +SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib" CACHE STRING + "Libraries linked by defalut with all applications.") +MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) + +FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES nmake ) +SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL + "What is the target build tool cmake is generating for.") diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake new file mode 100644 index 0000000..cf46516 --- /dev/null +++ b/Modules/Platform/Windows.cmake @@ -0,0 +1,6 @@ +SET(CMAKE_STATIC_LIBRARY_PREFIX "") +SET(CMAKE_STATIC_LIBRARY_SUFFIX ".lib") +SET(CMAKE_SHARED_LIBRARY_PREFIX "") # lib +SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so +SET(CMAKE_LINK_LIBRARY_SUFFIX ".lib") +SET(CMAKE_DL_LIBS "") diff --git a/Modules/Platform/Xenix.cmake b/Modules/Platform/Xenix.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Modules/Platform/Xenix.cmake diff --git a/Modules/Platform/gcc.cmake b/Modules/Platform/gcc.cmake new file mode 100644 index 0000000..55612bd --- /dev/null +++ b/Modules/Platform/gcc.cmake @@ -0,0 +1,18 @@ +SET (CMAKE_CXX_FLAGS "" CACHE STRING + "Flags used by the compiler during all build types.") + +SET (CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING + "Flags used by the compiler during debug builds.") + +SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O3" CACHE STRING + "Flags used by the compiler during release minsize builds.") + +SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING + "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") + +SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING + "Flags used by the compiler during Release with Debug Info builds.") + + +SET (CMAKE_C_FLAGS "" CACHE STRING + "Flags for C compiler.") |